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

fix(derive): Replace clap attributes with command, arg, and value #4180

Merged
merged 5 commits into from Sep 2, 2022

Conversation

epage
Copy link
Member

@epage epage commented Sep 2, 2022

Example:

/// Simple program to greet a person
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
    /// Name of the person to greet
    #[arg(short, long)]
    name: String,

    /// Number of times to greet
    #[arg(short, long, default_value_t = 1)]
    count: u8,
}

For the short term, this removes some of the magic so people have a better idea of how the derive connects to the builder API which is a continual problem (#4090) and makes it easier to document attributes generally.

Longer term, this is a step towards allowing command attributes on args/fields which will help with next_help_heading, etc. See #1807

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant