refactor: Redesign CLI #1
Labels
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: moanos/fediverse-blocklist-tool#1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The CLI interface is currently not designed well. As this project is not (yet) widely used it is a good idea to redesign the CLI now. This issue tracks possible options and progress of implementing these.
The base command will be abbreviate to
fbt
=fediverse-blocklist-tool
Proposed solution
No flag solution. While previously servers or files were identified by flag, this is not strictly necessary. If files/servers are given as arguments without the user specifying a type we can use the file extension to assume the user means a local file as non of our supported formats (toml,markdown,csv,json) is a valid TDL 1.
The order of arguments can specify which list will be input, output etc..
fbt diff local_blocklist.toml other_local_blocklist.json
: Works in any argument orderfbt diff ACCESS_TOKEN@fediserver1.org local_blocklist.toml
: Mixing local and remote blocklists is not a problemfbt export ACCESS_TOKEN@fediserver1.org blocklist_backup.toml
: Exporting works by first specifying the remote instance, then the local file. This is the only valid combintation (or should we allow to convert a file to a different format via this?)fbt deploy my_manual_blocklis.toml ACCESS_TOKEN@fediserver1.org
: Deploy must specify the source as first argument and the target as second argument. There is no reason why the first argument couldn't be a server but the second MUST be a serverThe
ACCESS_TOKEN@fediserver.org
syntax assumes there isn't an@
in either strings. If this is a problem we can work around this with using environment variables for the access token and implementing something like--literal
for the domain (if ever necessary)