package pflagfork

Import Path
	github.com/rsteube/carapace/internal/pflagfork (on go.dev)

Dependency Relation
	imports 7 packages, and imported by 3 packages

Involved Source Files flag.go flagset.go
Package-Level Type Names (total 2)
/* sort by: | */
Args []string Flag *pflag.Flag // used by cobra.Command bash autocomple code // If the user set the value (or if left to default) // default value (as text); for usage message // If this flag is deprecated, this string is the new or now thing to use // used by cobra.Command to allow flags to be hidden from help/usage text // name as it appears on command line // default value (as text); if the flag is on the command line without any options // one-letter abbreviated flag // If the shorthand of this flag is deprecated, this string is the new or now thing to use // help message // value as set Prefix string ( Flag) Consumes(arg string) bool ( Flag) Definition() string ( Flag) IsOptarg() bool ( Flag) IsRepeatable() bool ( Flag) Mode() mode ( Flag) Nargs() int ( Flag) OptargDelimiter() rune ( Flag) Required() bool ( Flag) Style() string ( Flag) TakesValue() bool func FlagSet.LookupArg(arg string) (result *Flag) func FlagSet.ShorthandLookup(name string) *Flag
FlagSet *pflag.FlagSet ParseErrorsWhitelist is used to configure a whitelist of errors SortFlags is used to indicate, if user wants to have sorted flags in help/usage messages. Usage is the function called when an error occurs while parsing flags. The field is a function (not a method) that may be changed to point to a custom error handler. AddFlag will add the flag to the FlagSet AddFlagSet adds one FlagSet to another. If a flag is already present in f the flag from newSet will be ignored. AddGoFlag will add the given *flag.Flag to the pflag.FlagSet AddGoFlagSet will add the given *flag.FlagSet to the pflag.FlagSet Arg returns the i'th argument. Arg(0) is the first remaining argument after flags have been processed. Args returns the non-flag arguments. ArgsLenAtDash will return the length of f.Args at the moment when a -- was found during arg parsing. This allows your program to know which args were before the -- and which came after. Bool defines a bool flag with specified name, default value, and usage string. The return value is the address of a bool variable that stores the value of the flag. BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash. BoolSlice defines a []bool flag with specified name, default value, and usage string. The return value is the address of a []bool variable that stores the value of the flag. BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash. BoolSliceVar defines a boolSlice flag with specified name, default value, and usage string. The argument p points to a []bool variable in which to store the value of the flag. BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash. BoolVar defines a bool flag with specified name, default value, and usage string. The argument p points to a bool variable in which to store the value of the flag. BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash. BytesBase64 defines an []byte flag with specified name, default value, and usage string. The return value is the address of an []byte variable that stores the value of the flag. BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash. BytesBase64Var defines an []byte flag with specified name, default value, and usage string. The argument p points to an []byte variable in which to store the value of the flag. BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash. BytesHex defines an []byte flag with specified name, default value, and usage string. The return value is the address of an []byte variable that stores the value of the flag. BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash. BytesHexVar defines an []byte flag with specified name, default value, and usage string. The argument p points to an []byte variable in which to store the value of the flag. BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash. Changed returns true if the flag was explicitly set during Parse() and false otherwise Count defines a count flag with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the flag. A count flag will add 1 to its value every time it is found on the command line CountP is like Count only takes a shorthand for the flag name. CountVar defines a count flag with specified name, default value, and usage string. The argument p points to an int variable in which to store the value of the flag. A count flag will add 1 to its value every time it is found on the command line CountVarP is like CountVar only take a shorthand for the flag name. Duration defines a time.Duration flag with specified name, default value, and usage string. The return value is the address of a time.Duration variable that stores the value of the flag. DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash. DurationSlice defines a []time.Duration flag with specified name, default value, and usage string. The return value is the address of a []time.Duration variable that stores the value of the flag. DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash. DurationSliceVar defines a durationSlice flag with specified name, default value, and usage string. The argument p points to a []time.Duration variable in which to store the value of the flag. DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash. DurationVar defines a time.Duration flag with specified name, default value, and usage string. The argument p points to a time.Duration variable in which to store the value of the flag. DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash. FlagUsages returns a string containing the usage information for all flags in the FlagSet FlagUsagesWrapped returns a string containing the usage information for all flags in the FlagSet. Wrapped to `cols` columns (0 for no wrapping) Float32 defines a float32 flag with specified name, default value, and usage string. The return value is the address of a float32 variable that stores the value of the flag. Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash. Float32Slice defines a []float32 flag with specified name, default value, and usage string. The return value is the address of a []float32 variable that stores the value of the flag. Float32SliceP is like Float32Slice, but accepts a shorthand letter that can be used after a single dash. Float32SliceVar defines a float32Slice flag with specified name, default value, and usage string. The argument p points to a []float32 variable in which to store the value of the flag. Float32SliceVarP is like Float32SliceVar, but accepts a shorthand letter that can be used after a single dash. Float32Var defines a float32 flag with specified name, default value, and usage string. The argument p points to a float32 variable in which to store the value of the flag. Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash. Float64 defines a float64 flag with specified name, default value, and usage string. The return value is the address of a float64 variable that stores the value of the flag. Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash. Float64Slice defines a []float64 flag with specified name, default value, and usage string. The return value is the address of a []float64 variable that stores the value of the flag. Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash. Float64SliceVar defines a float64Slice flag with specified name, default value, and usage string. The argument p points to a []float64 variable in which to store the value of the flag. Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash. Float64Var defines a float64 flag with specified name, default value, and usage string. The argument p points to a float64 variable in which to store the value of the flag. Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash. GetBool return the bool value of a flag with the given name GetBoolSlice returns the []bool value of a flag with the given name. GetBytesBase64 return the []byte value of a flag with the given name GetBytesHex return the []byte value of a flag with the given name GetCount return the int value of a flag with the given name GetDuration return the duration value of a flag with the given name GetDurationSlice returns the []time.Duration value of a flag with the given name GetFloat32 return the float32 value of a flag with the given name GetFloat32Slice return the []float32 value of a flag with the given name GetFloat64 return the float64 value of a flag with the given name GetFloat64Slice return the []float64 value of a flag with the given name GetIP return the net.IP value of a flag with the given name GetIPNet return the net.IPNet value of a flag with the given name GetIPNetSlice returns the []net.IPNet value of a flag with the given name GetIPSlice returns the []net.IP value of a flag with the given name GetIPv4Mask return the net.IPv4Mask value of a flag with the given name GetInt return the int value of a flag with the given name GetInt16 returns the int16 value of a flag with the given name GetInt32 return the int32 value of a flag with the given name GetInt32Slice return the []int32 value of a flag with the given name GetInt64 return the int64 value of a flag with the given name GetInt64Slice return the []int64 value of a flag with the given name GetInt8 return the int8 value of a flag with the given name GetIntSlice return the []int value of a flag with the given name GetNormalizeFunc returns the previously set NormalizeFunc of a function which does no translation, if not set previously. GetString return the string value of a flag with the given name GetStringArray return the []string value of a flag with the given name GetStringSlice return the []string value of a flag with the given name GetStringToInt return the map[string]int value of a flag with the given name GetStringToInt64 return the map[string]int64 value of a flag with the given name GetStringToString return the map[string]string value of a flag with the given name GetUint return the uint value of a flag with the given name GetUint16 return the uint16 value of a flag with the given name GetUint32 return the uint32 value of a flag with the given name GetUint64 return the uint64 value of a flag with the given name GetUint8 return the uint8 value of a flag with the given name GetUintSlice returns the []uint value of a flag with the given name. HasAvailableFlags returns a bool to indicate if the FlagSet has any flags that are not hidden. HasFlags returns a bool to indicate if the FlagSet has any flags defined. IP defines an net.IP flag with specified name, default value, and usage string. The return value is the address of an net.IP variable that stores the value of the flag. IPMask defines an net.IPMask flag with specified name, default value, and usage string. The return value is the address of an net.IPMask variable that stores the value of the flag. IPMaskP is like IPMask, but accepts a shorthand letter that can be used after a single dash. IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string. The argument p points to an net.IPMask variable in which to store the value of the flag. IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. IPNet defines an net.IPNet flag with specified name, default value, and usage string. The return value is the address of an net.IPNet variable that stores the value of the flag. IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash. IPNetSlice defines a []net.IPNet flag with specified name, default value, and usage string. The return value is the address of a []net.IPNet variable that stores the value of that flag. IPNetSliceP is like IPNetSlice, but accepts a shorthand letter that can be used after a single dash. IPNetSliceVar defines a ipNetSlice flag with specified name, default value, and usage string. The argument p points to a []net.IPNet variable in which to store the value of the flag. IPNetSliceVarP is like IPNetSliceVar, but accepts a shorthand letter that can be used after a single dash. IPNetVar defines an net.IPNet flag with specified name, default value, and usage string. The argument p points to an net.IPNet variable in which to store the value of the flag. IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash. IPP is like IP, but accepts a shorthand letter that can be used after a single dash. IPSlice defines a []net.IP flag with specified name, default value, and usage string. The return value is the address of a []net.IP variable that stores the value of that flag. IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash. IPSliceVar defines a ipSlice flag with specified name, default value, and usage string. The argument p points to a []net.IP variable in which to store the value of the flag. IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash. IPVar defines an net.IP flag with specified name, default value, and usage string. The argument p points to an net.IP variable in which to store the value of the flag. IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash. Init sets the name and error handling property for a flag set. By default, the zero FlagSet uses an empty name and the ContinueOnError error handling policy. Int defines an int flag with specified name, default value, and usage string. The return value is the address of an int variable that stores the value of the flag. Int16 defines an int16 flag with specified name, default value, and usage string. The return value is the address of an int16 variable that stores the value of the flag. Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash. Int16Var defines an int16 flag with specified name, default value, and usage string. The argument p points to an int16 variable in which to store the value of the flag. Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash. Int32 defines an int32 flag with specified name, default value, and usage string. The return value is the address of an int32 variable that stores the value of the flag. Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash. Int32Slice defines a []int32 flag with specified name, default value, and usage string. The return value is the address of a []int32 variable that stores the value of the flag. Int32SliceP is like Int32Slice, but accepts a shorthand letter that can be used after a single dash. Int32SliceVar defines a int32Slice flag with specified name, default value, and usage string. The argument p points to a []int32 variable in which to store the value of the flag. Int32SliceVarP is like Int32SliceVar, but accepts a shorthand letter that can be used after a single dash. Int32Var defines an int32 flag with specified name, default value, and usage string. The argument p points to an int32 variable in which to store the value of the flag. Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash. Int64 defines an int64 flag with specified name, default value, and usage string. The return value is the address of an int64 variable that stores the value of the flag. Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash. Int64Slice defines a []int64 flag with specified name, default value, and usage string. The return value is the address of a []int64 variable that stores the value of the flag. Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash. Int64SliceVar defines a int64Slice flag with specified name, default value, and usage string. The argument p points to a []int64 variable in which to store the value of the flag. Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash. Int64Var defines an int64 flag with specified name, default value, and usage string. The argument p points to an int64 variable in which to store the value of the flag. Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash. Int8 defines an int8 flag with specified name, default value, and usage string. The return value is the address of an int8 variable that stores the value of the flag. Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash. Int8Var defines an int8 flag with specified name, default value, and usage string. The argument p points to an int8 variable in which to store the value of the flag. Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash. IntP is like Int, but accepts a shorthand letter that can be used after a single dash. IntSlice defines a []int flag with specified name, default value, and usage string. The return value is the address of a []int variable that stores the value of the flag. IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash. IntSliceVar defines a intSlice flag with specified name, default value, and usage string. The argument p points to a []int variable in which to store the value of the flag. IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. IntVar defines an int flag with specified name, default value, and usage string. The argument p points to an int variable in which to store the value of the flag. IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash. ( FlagSet) IsInterspersed() bool ( FlagSet) IsMutuallyExclusive(flag *pflag.Flag) bool ( FlagSet) IsPosix() bool ( FlagSet) IsShorthandSeries(arg string) bool Lookup returns the Flag structure of the named flag, returning nil if none exists. ( FlagSet) LookupArg(arg string) (result *Flag) MarkDeprecated indicated that a flag is deprecated in your program. It will continue to function but will not show up in help or usage messages. Using this flag will also print the given usageMessage. MarkHidden sets a flag to 'hidden' in your program. It will continue to function but will not show up in help or usage messages. MarkShorthandDeprecated will mark the shorthand of a flag deprecated in your program. It will continue to function but will not show up in help or usage messages. Using this flag will also print the given usageMessage. NArg is the number of arguments remaining after flags have been processed. NFlag returns the number of flags that have been set. Name returns the name of the flag set. Output returns the destination for usage and error messages. os.Stderr is returned if output was not set or was set to nil. Parse parses flag definitions from the argument list, which should not include the command name. Must be called after all flags in the FlagSet are defined and before flags are accessed by the program. The return value will be ErrHelp if -help was set but not defined. ParseAll parses flag definitions from the argument list, which should not include the command name. The arguments for fn are flag and value. Must be called after all flags in the FlagSet are defined and before flags are accessed by the program. The return value will be ErrHelp if -help was set but not defined. Parsed reports whether f.Parse has been called. PrintDefaults prints, to standard error unless configured otherwise, the default values of all defined flags in the set. Set sets the value of the named flag. SetAnnotation allows one to set arbitrary annotations on a flag in the FlagSet. This is sometimes used by spf13/cobra programs which want to generate additional bash completion information. SetInterspersed sets whether to support interspersed option/non-option arguments. SetNormalizeFunc allows you to add a function which can translate flag names. Flags added to the FlagSet will be translated and then when anything tries to look up the flag that will also be translated. So it would be possible to create a flag named "getURL" and have it translated to "geturl". A user could then pass "--getUrl" which may also be translated to "geturl" and everything will work. SetOutput sets the destination for usage and error messages. If output is nil, os.Stderr is used. ( FlagSet) ShorthandLookup(name string) *Flag String defines a string flag with specified name, default value, and usage string. The return value is the address of a string variable that stores the value of the flag. StringArray defines a string flag with specified name, default value, and usage string. The return value is the address of a []string variable that stores the value of the flag. The value of each argument will not try to be separated by comma. Use a StringSlice for that. StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash. StringArrayVar defines a string flag with specified name, default value, and usage string. The argument p points to a []string variable in which to store the values of the multiple flags. The value of each argument will not try to be separated by comma. Use a StringSlice for that. StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash. StringP is like String, but accepts a shorthand letter that can be used after a single dash. StringSlice defines a string flag with specified name, default value, and usage string. The return value is the address of a []string variable that stores the value of the flag. Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. For example: --ss="v1,v2" --ss="v3" will result in []string{"v1", "v2", "v3"} StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash. StringSliceVar defines a string flag with specified name, default value, and usage string. The argument p points to a []string variable in which to store the value of the flag. Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. For example: --ss="v1,v2" --ss="v3" will result in []string{"v1", "v2", "v3"} StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash. StringToInt defines a string flag with specified name, default value, and usage string. The return value is the address of a map[string]int variable that stores the value of the flag. The value of each argument will not try to be separated by comma StringToInt64 defines a string flag with specified name, default value, and usage string. The return value is the address of a map[string]int64 variable that stores the value of the flag. The value of each argument will not try to be separated by comma StringToInt64P is like StringToInt64, but accepts a shorthand letter that can be used after a single dash. StringToInt64Var defines a string flag with specified name, default value, and usage string. The argument p point64s to a map[string]int64 variable in which to store the values of the multiple flags. The value of each argument will not try to be separated by comma StringToInt64VarP is like StringToInt64Var, but accepts a shorthand letter that can be used after a single dash. StringToIntP is like StringToInt, but accepts a shorthand letter that can be used after a single dash. StringToIntVar defines a string flag with specified name, default value, and usage string. The argument p points to a map[string]int variable in which to store the values of the multiple flags. The value of each argument will not try to be separated by comma StringToIntVarP is like StringToIntVar, but accepts a shorthand letter that can be used after a single dash. StringToString defines a string flag with specified name, default value, and usage string. The return value is the address of a map[string]string variable that stores the value of the flag. The value of each argument will not try to be separated by comma StringToStringP is like StringToString, but accepts a shorthand letter that can be used after a single dash. StringToStringVar defines a string flag with specified name, default value, and usage string. The argument p points to a map[string]string variable in which to store the values of the multiple flags. The value of each argument will not try to be separated by comma StringToStringVarP is like StringToStringVar, but accepts a shorthand letter that can be used after a single dash. StringVar defines a string flag with specified name, default value, and usage string. The argument p points to a string variable in which to store the value of the flag. StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash. Uint defines a uint flag with specified name, default value, and usage string. The return value is the address of a uint variable that stores the value of the flag. Uint16 defines a uint flag with specified name, default value, and usage string. The return value is the address of a uint variable that stores the value of the flag. Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash. Uint16Var defines a uint flag with specified name, default value, and usage string. The argument p points to a uint variable in which to store the value of the flag. Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash. Uint32 defines a uint32 flag with specified name, default value, and usage string. The return value is the address of a uint32 variable that stores the value of the flag. Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash. Uint32Var defines a uint32 flag with specified name, default value, and usage string. The argument p points to a uint32 variable in which to store the value of the flag. Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash. Uint64 defines a uint64 flag with specified name, default value, and usage string. The return value is the address of a uint64 variable that stores the value of the flag. Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash. Uint64Var defines a uint64 flag with specified name, default value, and usage string. The argument p points to a uint64 variable in which to store the value of the flag. Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash. Uint8 defines a uint8 flag with specified name, default value, and usage string. The return value is the address of a uint8 variable that stores the value of the flag. Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash. Uint8Var defines a uint8 flag with specified name, default value, and usage string. The argument p points to a uint8 variable in which to store the value of the flag. Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash. UintP is like Uint, but accepts a shorthand letter that can be used after a single dash. UintSlice defines a []uint flag with specified name, default value, and usage string. The return value is the address of a []uint variable that stores the value of the flag. UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash. UintSliceVar defines a uintSlice flag with specified name, default value, and usage string. The argument p points to a []uint variable in which to store the value of the flag. UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash. UintVar defines a uint flag with specified name, default value, and usage string. The argument p points to a uint variable in which to store the value of the flag. UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash. Var defines a flag with the specified name and usage string. The type and value of the flag are represented by the first argument, of type Value, which typically holds a user-defined implementation of Value. For instance, the caller could create a flag that turns a comma-separated string into a slice of strings by giving the slice the methods of Value; in particular, Set would decompose the comma-separated string into the slice. VarP is like Var, but accepts a shorthand letter that can be used after a single dash. VarPF is like VarP, but returns the flag created Visit visits the flags in lexicographical order or in primordial order if f.SortFlags is false, calling fn for each. It visits only those flags that have been set. (*FlagSet) VisitAll(fn func(*Flag)) FlagSet : github.com/polarsignals/frostdb/query/logicalplan.Named
Package-Level Constants (total 3)
const Default mode = 0 // default behaviour
const NameAsShorthand mode = 2 // non-posix mode where the name is also added as shorthand (single `-` prefix)
const ShorthandOnly mode = 1 // only the shorthand should be used