argparse
argparse copied to clipboard
Argparse for golang. Just because `flag` sucks
This PR concerns #20 ([Positional Arguments issue](https://github.com/akamensky/argparse/issues/20)) This PR is solely to provide a prototype for a grounded discussion on implementation of positional arguments. @akamensky I am eager to hear...
When I define a `File` arg (like following) to specify an input file, ``` -i ``` I wish we can specify the `-` value to input from the standard input...
For some tools it makes more sense to use positional arguments instead of randomly located named arguments. The positional arguments must work as follows: 1. Positional arguments can be placed...
If I define ``` host := parser.String("h", "host", &argparse.Options{Required: false, Help: "listening host", Default: "127.0.0.1"}) // ... ``` I'll get a panic -> > panic: unable to add String: short...
Hello, I want to add a list to help message, so each item should be on a new line. Now this looks not very good: ``` --input Possible values: not...
1. Take constant or variable number of arguments that follow 2. Important for optional arguments 3. Does not make much sense for positional arguments
We should enable a SelectorList argument type which accepts a list of strings which match the Selector criteria
Positionals (added in 1.4) currently ignore the Required option. It should be supported, with these basic requirements: - Required positionals must have a value supplied by the user (not by...
```go var cmdRootParser = argparse.NewParser("crank", "cli") var debugFlag = cmdRootParser.Flag("", "debug", &argparse.Options{Default: false}) var versionFlag = cmdRootParser.Flag("", "version", &argparse.Options{}) var updateCmd = cmdRootParser.NewCommand("update", "update self") var showCmd = cmdRootParser.NewCommand("show", "show...