-
Notifications
You must be signed in to change notification settings - Fork 327
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
Update to abscissa 0.6.0-beta.1 and clap 3.0.0-beta.5 #1576
Conversation
Problems to be resolved:
|
I had a cursory look over the PR. Great job so far, Mikhail! I have a question regarding dependency management: is it appropriate for |
As these are dependencies of the |
9b75c6d
to
dd8c116
Compare
22e2ad8
to
7683fa4
Compare
Overhaul command line argument processing to use clap instead of gumdrop.
Need this to resolve the dependency conflict on clap. Does not compile because of the API break.
The version string for chain config memos that was previously obtained from abscissa is obtained with the crate_version! macro from clap.
Tests rely on the `version` subcommand being implemented.
This is cumbersome, but it's the only way to support multiple occurrences of --event flag as of clap 3.0.0-beta.5. Should be fixed by the clap 3.0.0 release.
To avoid a panic in the terminal component initialization over an attempt to install a global eyre handler after the application has already done so, we need to tell the terminal to not use colors.
e3451fe
to
5cbf1be
Compare
I came across this from the backlink in clap 1772. I'm curious, any feedback on clap in making this transition? |
Overall, It's been smooth and, as previously experienced with The derive macro is not documented in detail in the One badly needed fix is clap-rs/clap#1772. I had to look into the code of clap-derive to understand how to manually write the It would be nice to have settings to disable only the small or the long flag for version and help: we've got subcommands that use Thank you @epage for your hard work! |
Yes, this will be addressed before 3.0.
Mind providing feedback on what you want to see from the derives? I have clap-rs/clap#2993 as one proposal.
I've been trying to move in this direction, trying to meet the goals:
All the breaking changes to meet these goals are complete. The rest is in documentation which is a lower priority than just getting the derives out in a stable release. Any feedback on what you want in documentation is welcome!
Whats the use case for a non-help As a hack, you could re-assign the short with
Its been a while since I've dug into this part, is this just an issue of setting version or setting PropagateVersion |
I support the changes outlined there. The main thing is, a There may be also a need to override the special type treatment and let the user provide a custom accumulating parser/validator for the strings produced by
I think basic examples of hand-written implementation for
Well, folks here have been using it as the short for
Sorry, I was trying to say that the application-specified |
👍 |
@mzabaluev Can you point me to the place where we rely on |
Sure, I have annotated it with a FIXME: https://github.com/informalsystems/ibc-rs/blob/c33820497a319779c4de4c52a0f0038298be1722/relayer-cli/src/commands/create/channel.rs#L60 |
To avoid confusion with the --version flag conventionally used to print the program version, the new long name is --channel-version. The --version flag is still supported with the present meaning on the `create channel` subcommand, but this alias is no longer described in built-in help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's revert the guide updates and do them in the release PR, otherwise the guide will be out of sync with the latest published version of the relayer since it's published automatically from master
, cf. #609
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mzabaluev Thank you so much for stepping up to this tedious task 🌻
@romac No problem, some light hazing for a newcomer 😁 |
…s#1576) * Update to abscissa 0.6.0-beta.1 and clap 0.3 Overhaul command line argument processing to use clap instead of gumdrop. * Attempt to update to modelator 0.3.2 Need this to resolve the dependency conflict on clap. Does not compile because of the API break. * refactor modelator code with latest api * cli: De-hardcode crate version The version string for chain config memos that was previously obtained from abscissa is obtained with the crate_version! macro from clap. * hermes: Fix panic in terminal color initialization * Resurrect the version subcommand Tests rely on the `version` subcommand being implemented. * Manually implement clap::Parser for listen command This is cumbersome, but it's the only way to support multiple occurrences of --event flag as of clap 3.0.0-beta.5. Should be fixed by the clap 3.0.0 release. * Add changelog entry * Fix `default_value` for `Order` in a couple commands * Fix handling of timeout options in `ft-transfer` * Wait a bit longer in passive connection test to avoid spurious failures * cli: Suppress terminal color in abscissa To avoid a panic in the terminal component initialization over an attempt to install a global eyre handler after the application has already done so, we need to tell the terminal to not use colors. * Improve info message in `listen` command * Rename --version flag of `create channel` cmd To avoid confusion with the --version flag conventionally used to print the program version, the new long name is --channel-version. The --version flag is still supported with the present meaning on the `create channel` subcommand, but this alias is no longer described in built-in help. * Updated the guide on availability of --help flags * Revert guide updates, to be done in the release PR Co-authored-by: Ranadeep Biswas <mail@rnbguy.at> Co-authored-by: Romain Ruetschi <romain@informal.systems>
Closes: #134
Description
Overhaul command line argument processing to use the
clap_derive
macro instead ofgumdrop
.Caveats
Usage of flags like
-h
and--version
in subcommands is ambiguous with the flags automatically supported by clap for conventional help and version printouts. This is highlighted by FIXME comments and clap settings disabling the automatically generated flags for these select subcommands.--help
is also not available for the subcommands that use-h
for something else, because the clap setting can only suppress both long and short help flags.gumdrop is still used by tendermint-testgen, so it's not removed from the dependency tree (there's one version less of it now, though)
For contributor use:
unclog
.docs/
) and code comments.Files changed
in the Github PR explorer.