-
Notifications
You must be signed in to change notification settings - Fork 357
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
Better message, usage, option help and completion for CLIs #2349
Comments
The description is the short version since the help was called with Regarding the other issues you mentioned, I will look them up while working on the PR for the unit tests of the CLI command parsing. |
After some additional experimentation, there is a potential solution for the ordering and the help headers, but it requires modifying every commands. By adding
It is possible to remove the Once the
The advantages are that the help display message has the essential information and cleanly organised. The disadvantage could be compensated with a unit test with the following format:
What do you think ? |
Thanks a lot for looking into this! While this would work, it seems like a lot of effort for fairly minimal gains. I think we'll just stick with What we can do to ensure users are more likely to see the full help message is direct them towards using the |
I agree, the tradeoff between effort and gain was one of my concerns. I will stick to only adding the I think it's a great idea to encourage the usage of the |
* Adding unit tests for all Hermes commands with at least one argument. * Instead of manually validating the flags, the validation is done by `clap` for commands `create channel`, `create connection`, `keys add` and `keys delete`. * Minor changes to the guide. * Updated the ADR 010 with the new `--yes` optional flag for the command `create channel`. --- * Updated CLI commands to take flags everywhere and updated e2e tests accordingly * Updated gm to use flags when calling Hermes * Added missing flags to e2e test for 'query client state' command * Fixed flag errors in e2e tests and removed conflicting short flag. * Removed all short flags and updated CLI commands comments * Removed forgotten short flags. * Updated Hermes guide with flags instead of positional arguments * Updated script and comment with new long flags for Hermes * Completed 'tx raw upgrade-' commands guide page. Updated Testing client upgrade guide page * Added changelog entry * Added example unit-tests to the 'keys add' command * Added value names to parameters and removed cli parsing unit-tests * Cargo fmt changes * Updated flags in order to reflect ADR 010 * Updated guide to reflect flag changes from ADR 010 * Updated gm script and e2e tests to match flag changes from ADR 010 * Fixed ADR 010 typo * Added unit-testing CLI argument parsing * Updated unit tests for CLI and improved help output * Improved 'override_usage' for commands with multiple usages * Updated Hermes guide. Removed changes for issue #2349, they will be added in a separate PR. * Removed manual validation for 'keys add' and 'keys delete' flags. * Added changelog entry * Updated unit tests for command 'clear packets' to include new optional flags * Cargo fmt * Fixed 'keys add' in ADR 010 and added shell completion unit test for case with no flag * Fix clippy warnings introduced in Rust 1.62 Co-authored-by: Romain Ruetschi <[email protected]>
…lsystems#2352) * Adding unit tests for all Hermes commands with at least one argument. * Instead of manually validating the flags, the validation is done by `clap` for commands `create channel`, `create connection`, `keys add` and `keys delete`. * Minor changes to the guide. * Updated the ADR 010 with the new `--yes` optional flag for the command `create channel`. --- * Updated CLI commands to take flags everywhere and updated e2e tests accordingly * Updated gm to use flags when calling Hermes * Added missing flags to e2e test for 'query client state' command * Fixed flag errors in e2e tests and removed conflicting short flag. * Removed all short flags and updated CLI commands comments * Removed forgotten short flags. * Updated Hermes guide with flags instead of positional arguments * Updated script and comment with new long flags for Hermes * Completed 'tx raw upgrade-' commands guide page. Updated Testing client upgrade guide page * Added changelog entry * Added example unit-tests to the 'keys add' command * Added value names to parameters and removed cli parsing unit-tests * Cargo fmt changes * Updated flags in order to reflect ADR 010 * Updated guide to reflect flag changes from ADR 010 * Updated gm script and e2e tests to match flag changes from ADR 010 * Fixed ADR 010 typo * Added unit-testing CLI argument parsing * Updated unit tests for CLI and improved help output * Improved 'override_usage' for commands with multiple usages * Updated Hermes guide. Removed changes for issue informalsystems#2349, they will be added in a separate PR. * Removed manual validation for 'keys add' and 'keys delete' flags. * Added changelog entry * Updated unit tests for command 'clear packets' to include new optional flags * Cargo fmt * Fixed 'keys add' in ADR 010 and added shell completion unit test for case with no flag * Fix clippy warnings introduced in Rust 1.62 Co-authored-by: Romain Ruetschi <[email protected]>
@ljoss17 @mzabaluev
Summary
So not sure this is a feature request or a bug and if there is anything we can do about it.
With the new CLIs in master, the USAGE and help are strange and sometimes not correct.
For example:
There are a few issues for this one:
Create a new channel between two chains using a pre-existing connection
is wrong, that is not the only option. Seems that a blank line (create.rs
) in the description drops everything after when displayed with -h--a-chain
appears both inUSAGE
and inOPTIONS
. The required flags should not be[OPTIONS]
-h, --help
appears in the middle of the option list. Is there a way to control the order in which they are listed?Haven't checked all CLIs but I expect most of the above will show there.
Maybe most or all of these issues where there before but we should cleanup as much as possible before v1.0.
Problem Definition
Proposal
Acceptance Criteria
For Admin Use
The text was updated successfully, but these errors were encountered: