-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Global arguments with a requires
clause don't work under subcommands when specified through environment variables
#5020
Labels
C-bug
Category: Updating dependencies
Comments
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Jul 19, 2023
Although see clap-rs/clap#5020
This is tied very closely to #1546 except we aren't verifying other required-related fields. |
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Aug 8, 2023
As there are several potential sources of configuration, the collation mode is relevant whether a invocation-specific configuration file is specified, or not. This has the cheery consequence of sidestepping the issue described in clap-rs/clap#5020.
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Aug 14, 2023
* Add env feature to clap and cargo update * Dead Code: WIP CLI changes * Dead Code: CLI feature parity Although see clap-rs/clap#5020 * Note about not (yet) using infer_subcommands See clap-rs/clap#5021 * Use clap/wrap_help Although see clap-rs/clap#5022 * WIP: Strip out previous CLI argument parser setup [skip ci] * WIP: Normalise arguments for caller [skip ci] * Don't check for file-ness in the CLI argument parser * File and directory canonicalisation for the argument parser * Expose CLI types so they can be used downstream
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Aug 14, 2023
* Add env feature to clap and cargo update * Dead Code: WIP CLI changes * Dead Code: CLI feature parity Although see clap-rs/clap#5020 * Note about not (yet) using infer_subcommands See clap-rs/clap#5021 * Use clap/wrap_help Although see clap-rs/clap#5022 * WIP: Strip out previous CLI argument parser setup [skip ci] * WIP: Normalise arguments for caller [skip ci] * Don't check for file-ness in the CLI argument parser * File and directory canonicalisation for the argument parser * Expose CLI types so they can be used downstream
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Aug 14, 2023
As there are several potential sources of configuration, the collation mode is relevant whether a invocation-specific configuration file is specified, or not. This has the cheery consequence of sidestepping the issue described in clap-rs/clap#5020.
Xophmeister
added a commit
to tweag/topiary
that referenced
this issue
Aug 15, 2023
* Implement Display for Configuration: pretty-print TOML * Comment out old code, stub out new interface implementation * Additional collation mode * Some light refactoring * More refactoring... * Make the config collation independent of a specified config file As there are several potential sources of configuration, the collation mode is relevant whether a invocation-specific configuration file is specified, or not. This has the cheery consequence of sidestepping the issue described in clap-rs/clap#5020. * Add useful annotations to the computed TOML output * Refactor 'revise' collation mode from original * Remove unnecessary trailing \n from TOML output * Syntax tweak
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please complete the following tasks
Rust Version
rustc 1.70.0 (90c541806 2023-05-31) (built from a source tarball)
Clap Version
4.3.13
Minimal reproducible code
Steps to reproduce the bug with the above code
Actual Behaviour
Complains about the
-f FOO
argument being missing, even though it isn't:Expected Behaviour
Outputs the following:
Additional Context
This only appears to happen within the subcommand. If the subcommands are optional, this works as expected (but only at the top-level, when no subcommand is specified):
With non-optional subcommands, it does work as expected if the required argument is also specified through its environment variable:
Debug Output
The text was updated successfully, but these errors were encountered: