clue/commander

Support alternative options

Closed this issue · 1 comments

clue commented

We should add support for alternative options like this:

add [--verbose | -v]

This should match either add --verbose or add -v, but not both.

This is also useful for situations like this:

install [--dev | --no-dev]

Depends on #2

clue commented

For the reference: I've actually implemented this (local branch only so far) with explicit parenthesis syntax like this:

add (user | admin) <name>

While this makes sense in sentence expression like above, this is a bit fiddly for optional groups like this:

add [(--verbose | -v)]

This means that parenthesis should be part of the syntax, but actually be optional in cases where it's unambiguous.