go-flags icon indicating copy to clipboard operation
go-flags copied to clipboard

go command line option parser

Results 80 go-flags issues
Sort by recently updated
recently updated
newest added

Given: ``` var opts struct { Names []string } ``` I want to provide the tag dynamically since it will depend on the config file read before I parse the...

Say I have my app with nested subcommands ``` App sub1 sub2 ``` In order to check that I have run ```app sub1 sub2 --someflag``` I've been using. ``` if...

Hi, I noticed a "strange behaviour" with flags and environment variables. This is my configuration: ```go type Config struct { MyRequiredField string `env:"MY_REQUIRED_FIELD" long:"my-required-field" required:"true"` } func GetConfig(args []string) Config...

To avoid tag conflicts with other third-party libraries like [env](https://github.com/caarlos0/env) 1. support field tag prefix ```go type Cfg struct { Path string `flag-short:"p" flag-long:"path" flag-description:"path to xxx"` } cfg :=...

Given a struct field of type `map[string][]string` and `env` tag of `SOMEVAR`, how can one specify pairs in the environment variable? I recommend use of a semicolon. e.g.: `export SOMEVAR='foo1:bar1,bar2;foo2:bar3;foo1:bar4'`...

Given: ```go type Args struct { Foo string `env:"FOO" short:"f" long:"foo"` Bar PosArg `positional-args:"1"` } type PosArg struct { Pos string `env:"BAR" positional-arg-name:"POSITIONAL_ARG"` } ``` the execution of `BAR='a non-empty...

There is currently no working zsh-completion example. It took me a while to figure this out, so I wanted to commit it back to the repo for others. Especially since...

## Background: In order to parse custom flag types it is currently necessary to implement the `flags.Unmarshaler` and optionally the `flags.Marshaler ` interface. That interface is specific to this library,...

I have a case where I want to pass *nix file permissions as a command line option in standard octal format (e.g. `0600`). Unfortunately it looks like the package [is...