Open
Issue #1 · created by Göran Krampe


Ability to have logical groups of options and "case of"

Many tools have logical groups of options, or branches, typically chosen based on a command or similar. Currently if you have a mandatory option in Lapp, and also have "-h,--help" to show help - then you can't show help without having to supply that other mandatory option.

Proposal:

  • Use a blank line to create groups. If all options/parameters have been matched, we do not process further.
  • A given option/parameter can also be followed with indentation creating a "case of" based on that option/param.

Example:

-h,--help        If all options match within this group...
-v,--version     ...then no other options/parameters are matched since this is the first group
--verbose        This one can still be given together with more in subsequent groups.
                 This blank line
<command>        This is the second group.
  list           Indentation causes a "case of", list, remove etc.
    -l,--long    These options are only considered for the command "list"
  remove
    name         And this is mandatory parameter after the command "remove"
    --purge
    --all

1 participant