{"repo":"alexflint/go-arg","free":true,"listed":false,"github":"https://github.com/alexflint/go-arg","clone":"git clone https://github.com/alexflint/go-arg.git","description":"Struct-based argument parsing in Go","language":"Go","stars":2269,"topics":["argument-parsing","golang"],"license":"BSD-2-Clause","category":"cli-tools","readme_excerpt":"go-arg Struct-based argument parsing for Go Declare command line arguments for your program by defining a struct. Installation Required arguments Positional arguments Environment variables You can also override the name of the environment variable: You can provide multiple values in environment variables using commas: Command line arguments take precedence over environment variables: Configuring a global environment variable name prefix is also possible: Usage strings Default values Command line arguments take precedence over environment variables, which take precedence over default values. This means that we check whether a certain option was provided on the command line, then if not, we check for an environment variable (only if an env tag was provided), then if none is found, we check for a default tag containing a default value. Ignoring environment variables and/or default values Arguments with multiple values Arguments that can be specified multiple times, mixed with positionals Arguments with keys and values Version strings Note If a --version flag is defined in args or any subcommand, it overrides the built-in versioning. Custom validation Overriding option names Embedded structs The fields of embedded structs are treated just like regular fields: As usual, any field tagged with arg:\"-\" is ignored. Supported types The following types may be used as arguments: - built-in integer types: int, int8, int16, int32, int64, byte, rune - built-in floating point types: float32,","default_branch":null,"files":null,"tree":[],"storefront":"/r/alexflint","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/alexflint/go-arg/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}