l3nz / cli-matic

Compact, hands-free [sub]command line parsing library for Clojure.
Eclipse Public License 2.0
361 stars 29 forks source link

[Ftr] Separate positional arguments help from options help #92

Open lread opened 4 years ago

lread commented 4 years ago

Is your feature request related to a problem? Please describe. While looking at #90, I noticed that the help for positional arguments is included under the OPTIONS section, for example:

NAME:
 toycalc add - Adds two numbers together

 Looks great, doesn't it?

USAGE:
 toycalc [add|a] [command options] a1 a2

OPTIONS:
       --a1 N  0  First addendum [$AA]
       --a2 N  0  Second addendum
   -?, --help

Describe the solution you'd like I think separating out the positional args from the options would be clearer:

NAME:
 toycalc add - Adds two numbers together

 Looks great, doesn't it?

USAGE:
 toycalc [add|a] [command options] a1 a2

WHERE:
   a1 N  0  First addendum [$AA]
   a2 N  0  Second addendum

OPTIONS:
   -?, --help

Describe alternatives you've considered None at this time.

Additional context I do realize that the positional args would still be accessible via their equivalent options (eg --a1 and --a2) but if I have configured cli-matic for positional args, I would think the option equivalents could remain undocumented in the usage help.

lread commented 4 years ago

If this makes sense to folks, I can work on a PR.