commit | 7642663bf7467dd2ee5d443a737003516b87f159 | [log] [tgz] |
---|---|---|
author | Robert Iannucci <iannucci@chromium.org> | Wed Sep 22 12:54:03 2021 -0700 |
committer | GitHub <noreply@github.com> | Wed Sep 22 15:54:03 2021 -0400 |
tree | 3f13aa362ec02ff2db07ad704787590b15a84d54 | |
parent | 76e231eeaca7ff66be919327f1a05aa592097547 [diff] |
Allow GetFlags to return nil. (#9) This allows individual subcommands to indicate that they would like to take full control of the 'args' parsing. This is useful for when 'flag' is insufficiently groovy, or when writing wrapper programs where some or even none of the flags need to be interpreted by the wrapper itself (e.g. merely passed through to the target program). Without this, invocations such as `prog subcommand -flag` will fail because `-flag` would be interpreted as an 'unknown flag'.
This package permits a Go application to implement subcommands support similar to what is supported by the ‘go’ tool.
The library is designed so that the test cases can run concurrently. Using global flags variables is discouraged to keep your program testable concurrently.
The intended command is found via heuristic search;
lo
will run longcommand
as long as there's no command with the same prefix.longcmmand
or longcmomand
will properly trigger longcommand
.