pcapriotti / optparse-applicative

Applicative option parser
BSD 3-Clause "New" or "Revised" License
913 stars 116 forks source link

Multiple command groups yield bad error message #221

Closed nomeata closed 7 years ago

nomeata commented 8 years ago

I have started using commandGroup in this commit and it works ok, with the exception of the error message when no command is given, and also the summary:

$ tttool
Missing: (COMMAND | COMMAND | COMMAND | COMMAND | COMMAND)

Usage: tttool [-t|--transscript FILE] [--code-dim W[xH]] [--dpi DPI]
              [--pixel-size N] (COMMAND | COMMAND | COMMAND | COMMAND | COMMAND)
  tttool-1.6.1.2 -- The swiss army knife for the Tiptoi hacker
[..]

and

$ tttool -- --help
Usage: tttool [-t|--transscript FILE] [--code-dim W[xH]] [--dpi DPI]
              [--pixel-size N] (COMMAND | COMMAND | COMMAND | COMMAND | COMMAND)
[..]

Any suggestions on how to avoid that?

nomeata commented 8 years ago

Ok, I have a work-around, see the commit linked above. If that is the best way of doing it, then this is merely a request for better documentation. If there is a better way, then, well, as well.

HuwCampbell commented 8 years ago

Currently there's not a better way, as one can have different metavars for groups, or have subcommands which aren't alternatives. Will add some doc.

HuwCampbell commented 7 years ago

I'm happy with the way this is documented now. Although I could put in a fix to combine these on opposite sides of an alternative I think it would be extremely flakey.