Skip to content

Ambiguous help, short name duplicates #16

@rysson

Description

@rysson

I seems that first character of long-name is used in a short-name.

In case:

struct Options
{
  // oositional flags
  // ./main [--bar] [--baz]
  std::optional<bool> bar = false;
  std::optional<bool> baz = false;
};
STRUCTOPT(Options, bar, baz);

Help prints:

USAGE: my_app [FLAGS] [OPTIONS] 

FLAGS:
    -b, --bar
    -b, --baz

OPTIONS:
    -h, --help <help>
    -v, --version <version>

There are -b twice. Ii can be confusing, specially with many another options between duplicates.

BTW, it's possible (or is planned) to set flag name (short name)?

Maybe something like

std::optional<bool> baz = false;
...
STRUCTOPT(Options, bar, structopt::short(baz, "z"));

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions