-
Notifications
You must be signed in to change notification settings - Fork 2
Description
This is an idea for a clearer organization of the ummon commands. Here is the current state:
$ ummon
DOUBLE EXTRA HELP
Commands:
collection Set the default settings for a particular collection
config Get the server status as well as control various aspects of the server
log Show recent log output, filtered by collection, task, or run
pulse Ping server status for a queue/worker numbers
queue Show or clear the queue
status Get the server status as well as control various aspects of the server
task Show and modify the configuration for a task
help <sub-command> Show the --help for a specific command
$
It isn't a bad layout of options, but there's already a lot of overlap between two of the main commands: collection and task. For example, ummon task test --raw and ummon collection get-config test --pretty return very nearly the same information. Also, these commands tend to get pretty long once we get to the third argument ("get-config" in the latter example above).
I propose we move "task" and "collection" subcommands to their own top-level commands since many of them can operate over either a task or a collection. The set-config, get-config, copy, rename, disable, enable, and delete commands can all operate over both tasks and collections. The create and update commands may still operate on tasks only, since it would be hard to fit that kind of info for a collection on the command line. The get-defaults and set-defaults commands would only operate on collections.
With this refactor, commands would also align more closely with the methods in client.js.