-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI: Use flags everywhere instead of positional arguments #2239
Comments
I would like to use this issue in order to apply the following guidelines for the CLI command codes:
Would you consider this a good idea ? Or am I maybe missing some additional guidelines ? |
I think we should get rid of short flags altogether so that we don't have to deal with conflicts and make everything consistent. What do you think? |
Seeing the amount of fields with only long flags, for example all the |
I would also suggest we drop the |
Or maybe global flags should be long form only, as there are less of them and are optional, and have a short form for the other flags? I find short flags to be quite nice when you are running a lot of commands; explicitly typing out the long form args over and over can get annoying and distracting. And WDYT? |
Generally I prefer having short flags, but after passing through the commands of this CLI I saw that there aren't only potential conflicts with global flags. There are many commands which would require finding a meaningful short flag which isn't the first character. The following are some examples of commands which would require special short flags:
So I am a bit more in favor of having the default being all long flags, but reducing the length as @romac suggested so |
From what I managed to observe the two CLIs seem to have the mix of position arguments and flags which the current Hermes CLI has. Most of the flags are long only but some of them have a short option. Some examples are the following: For
|
Great summary Luca!
+1 |
Awesome, sounds good to me! |
Summary
All CLI commands should use flags (
--flag
) options instead of positional arguments.Problem Definition
At the moment, a lot of the CLI commands use a mix of positional arguments and flags, for example
the
create channel
CLI:When writing the commands it is now always clear what the positional arguments denote (eg. which is the source chain and destination chain), and one often has to resort to the command documentation (
--help
) to figure it out.Even worse, the number of positional arguments and their denotation for the
create channel
command change depending on which flags are passed, eg.vs
This is quite confusing, as expressed already by some operators: #1935
Proposal
I suggest using flags everywhere instead of positional arguments.
Positional arguments should be kept for the case where we want to pass a list of items to a command, which we don't have the need for currently.
Acceptance Criteria
All CLI commands accept only flags and no positional arguments.
For Admin Use
The text was updated successfully, but these errors were encountered: