-
-
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
YAML not parsed when name, version, author, about not specified in it #1338
Comments
I was able to work around this by specifying only the name in yml and the remaining properties via the crate! macros. |
I would say this is how it's supposed to work.
But I agree this should be documented better. |
I'm in a somewhat similar situation, didn't feel different enough to create a whole new issue. I do this in my code: let matches = App::from_yaml(yaml)
.name(Game::GAME_ID)
.version(Game::VERSION)
.author(Game::AUTHOR)
.about(Game::DESCRIPTION)
.get_matches(); Since I set all those there, I figured I could leave them out of the YAML file. But no. name: required_for_some_reason_even_though_it_is_defined_in_code
args:
- ... 😜 |
@alexschrod Well, this is inevitable. |
We have decided to deprecate the YAML API. For more details, see #3087. If there is interest in a YAML API, it will likely be broken out into a |
Rust Version
rustc 1.28.0 (9634041f0 2018-07-30)
Affected Version of clap
[dependencies.clap]
version = "2.31.2"
features = [ "yaml"]
Bug or Feature Request Summary
Expected Behavior Summary
By using method and macros build arguments from yml file where that filed not specified.
Actual Behavior Summary
Arguments list is ignored completely
Steps to Reproduce the issue
Sample Code or Link to Sample Code
cli.yml
main.rs
Debug output
Debug Output
The text was updated successfully, but these errors were encountered: