gumdrop icon indicating copy to clipboard operation
gumdrop copied to clipboard

Display positional arguments in 'usage' line.

Open nms-scribe opened this issue 1 year ago • 0 comments

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.

nms-scribe avatar Apr 17 '24 13:04 nms-scribe