Refactor optparsing
Opened this issue · 0 comments
jkarni commented
Our Optparse module has become very complicated, and there are further improvements, such as:
- not failing because of syntax errors in garn.ts when things like
--help
are requested - showing information about why a command is unavailable
- showing information about commands even if they're unavailable
That would be nice, but risk making the module worse. Some refactoring is in order.
One piece of functionality that I missed that I think make this possible are commandGroup
s. With this, I think we can just have a normal set of parsers, and based on the situation optionally set the commandGroup
and, I think, infoOption
/abortOption
. That should pretty dramatically simplify the module.