seaneagan / unscripted

Define command-line interfaces using ordinary dart methods and classes.
BSD 3-Clause "New" or "Revised" License
23 stars 10 forks source link

Option name prefix matching #24

Open seaneagan opened 10 years ago

seaneagan commented 10 years ago

Something like:

http://docs.python.org/2/library/argparse.html#argument-abbreviations-prefix-matching

One question is how it interacts with the existing 'abbr' feature. Possibly the prefix matching could be turned off when 'abbr' is specified. And 'abbr' could be used as a tie breaker when there are 2 options that start with the same character.

This, along with #11 could really drive down the need to use metadata annotations (since 'abbr' can be derived).

seaneagan commented 10 years ago

Hmm, maybe add an option to Command e.g. bool abbr which defaults to false, but if true, adds an abbr to each option of the first letter of that option, so long as it is not ambiguous (another option starting with the same letter.