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

Display positional arguments in 'usage' line. #60

Open
nms-scribe opened this issue Apr 17, 2024 · 0 comments
Open

Display positional arguments in 'usage' line. #60

nms-scribe opened this issue Apr 17, 2024 · 0 comments

Comments

@nms-scribe
Copy link

Right now, I have the following struct:

#[derive(Options)]
struct Arguments {

    /// print help message
    help: bool,    

    #[options(free,required)]
    /// The file to extract data from
    source: PathBuf,

    #[options(free,required)]
    /// The file to insert the data into
    target: PathBuf,
}

When I call the program with '--help', I get the following usage:

Usage: clitool [OPTIONS]

Positional arguments:
  source      The file to extract data from
  target      The file to insert the data into

Optional arguments:
  -h, --help  print help message

In almost every other command line tool on my system, that first line of Usage would be something like: Usage: clitool [OPTIONS] SOURCE TARGET.

Right now I have to duplicate the code from parse_args_or_exit in order to add this.

It would be nice if gumdrop did this automatically, or at least allowed me to customize the usage line.

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

No branches or pull requests

1 participant