args
args copied to clipboard
feat: show aliases in usage
- [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
What I did
- Add a flag to allow option alias(es) to be output by ArgParser's usage
- The default behaviour remains the same - i.e. aliases are not printed in usage
- Kind of like what is requested in https://github.com/dart-lang/args/issues/240 but for ArgParsers' Options, not CommandRunners' Commands
How I did it
- usage_test.dart:
- Add a test to verify that aliases are shown for options if requested
- Add a test to verify that aliases are not shown for options by default
- usage.dart: make _longOption also show aliases, if any, if showAliases is true
- added showAliases parameters in various places so that we can preserve current behaviour as default
- updated CHANGELOG.md