Skip to content
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

Make "name" optional in YAML -- nothing gets parsed if it's left out #2378

Closed
2 tasks done
jaques-sam opened this issue Mar 2, 2021 · 2 comments
Closed
2 tasks done
Labels
C-bug Category: Updating dependencies

Comments

@jaques-sam
Copy link

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Rust Version

1.48.0

Clap Version

2.33.3

Minimal reproducible code

Using rust edition 2018:

fn main() {
    let yaml = clap::load_yaml!("cli.yml");
    let matches = App::from_yaml(yaml).get_matches();
}

cli.yaml:

version: "1.0"
author: Tester <email@dummy.com>
about: parse command line parameters
args:
    - config:
        short: c
        long: config
        value_name: FILE
        help: Sets a custom config file
        takes_value: true

side note: why can I not make this window bigger (using Firefox)!! Very annoying :-(

Steps to reproduce the bug with the above code

cargo run -- --help

Actual Behaviour

Only the built-in help from clap is shown with the only parameters -h & -V

Expected Behaviour

Expect everything to work with the name of the of the program simply the one from Cargo.toml: package.name

Additional Context

No response

Debug Output

No response

@jaques-sam jaques-sam added the C-bug Category: Updating dependencies label Mar 2, 2021
@pksunkara
Copy link
Member

Duplicate of #1338. You did not search for issues.

@jaques-sam
Copy link
Author

Thanks for looking into it so quickly. Sorry, I did search but it was not successful indeed :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

2 participants