jarro2783 / cxxopts

Lightweight C++ command line option parser
MIT License
4.14k stars 579 forks source link

Positional arguments without options #237

Open k0j0n opened 4 years ago

k0j0n commented 4 years ago

I found the definition of positional arguments quite confusing. It was not obvious for me that they require to have an option defined for them. More importantly, the current way does not really lead to an understandable usage output (in my opinion).

I would prefer something like

Usage:
  untitled [OPTION...] <input>

  -h, --help        Print usage

over the current output, if the positional help is set appropriately

Usage:
  untitled [OPTION...] <input>

  -h, --help        Print usage
  -i, --input       same as <input>

i.e., without the need to introduce a "i,input" argument showing up in the help or being defined at all.

ruolin commented 4 years ago

I want to upvote this issue. +1

maximus5684 commented 3 years ago

@k0j0n I know this issue is old but if you do not set .show_positional_help() then you should not see the arguments that are placeholders for positional values.