Package Usage: go: github.com/spf13/flag
Package flag implements command-line flag parsing.
Usage:
Define flags using flag.String(), Bool(), Int(), etc.
This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
If you like, you can bind the flag to a variable using the Var() functions.
Or you can create custom flags that satisfy the Value interface (with
pointer receivers) and couple them to flag parsing by
For such flags, the default value is just the initial value of the variable.
After all flags are defined, call
to parse the command line into the defined flags.
Flags may then be used directly. If you're using the flags themselves,
they are all pointers; if you bind to variables, they're values.
After parsing, the arguments after the flag are available as the
slice flag.Args() or individually as flag.Arg(i).
The arguments are indexed from 0 through flag.NArg()-1.
Command line flag syntax:
One or two minus signs may be used; they are equivalent.
The last form is not permitted for boolean flags because the
meaning of the command
will change if there is a file called 0, false, etc. You must
use the -flag=false form to turn off a boolean flag.
Flag parsing stops just before the first non-flag argument
("-" is a non-flag argument) or after the terminator "--".
Integer flags accept 1234, 0664, 0x1234 and may be negative.
Boolean flags may be:
Duration flags accept any input valid for time.ParseDuration.
The default set of command-line flags is controlled by
top-level functions. The FlagSet type allows one to define
independent sets of flags, such as to implement subcommands
in a command-line interface. The methods of FlagSet are
analogous to the top-level functions for the command-line
flag set.
1 version
Latest release: about 11 years ago
1 dependent package
View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/github.com/spf13/flag
View more repository details: http://repos.ecosyste.ms/hosts/GitHub/repositories/spf13%2Fflag
Dependent Repos 3
cheld/miniprow
Robot for CI/CD PipelinesSize: 4.69 MB - Last synced: 11 months ago - Pushed: about 2 years ago

dabasov/0chain_sc_parallel
Size: 47.8 MB - Last synced: about 1 month ago - Pushed: over 3 years ago


vocdoni/votecaster
A farcaster frame for voting with Vocdoni a.k.a. VotecasterSize: 18.5 MB - Last synced: 13 days ago - Pushed: 5 months ago

