- Removes unused codepaths.
- Simplifies synopsis string codepaths by removing optionality. This
complexity is moved to the caller who is now responsible for filtering
out hidden arguments and options. This change is desirable as it
allows the caller to determine if the argument should be hidden. For
example, while it makes sense to hide arguments in help text, it may
not make sense to hide them when dumping the arguments for another
tool to consume.
This removes the nesting inside the ArgumentSet data structure, which
had semantic meaning in an earlier version. This flattening, plus a
switch to using dictionary lookup instead of linear scanning, provides
another performance boost.
* Use the first long name in usage (#167)
Sorting names for option has been changed.
* Usage will choose the first long name, if available, or otherwise the first short name
* Help screen will show short names, then long names, in the order of their declaration.
Solves (#167)
* Fix adding same name more than once.
Checkin long names in sort caused single dash long names to be treated as a short name.
Fixed sort to check “short” instead of “long”
Update current test to cover more cases.
* Add isShort control to Name
*Replace sortedNames with partitionedNames
*Extract uniquifying logic into SequenceExtensions.swift
* Refactor short test with computed property
* Use pattern-matching instead of equality comparison