Documentation ¶
Index ¶
- func ConsumeUnparsedValue(longForm string, shortForm byte, isBool bool, args []string) (string, bool, []string, error)
- func DeprecationIfChanged(cmd *cobra.Command, flagName, alternative string)
- func GetUnparsedBoolean(args []string, flag string) (bool, bool, error)
- func GetUnparsedValue(longForm string, shortForm byte, isBool bool, args []string) (string, bool, error)
- func HasOption(longForm string, shortForm byte, args []string) bool
- func Map(flags *pflag.FlagSet) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsumeUnparsedValue ¶ added in v2.21.0
func ConsumeUnparsedValue(longForm string, shortForm byte, isBool bool, args []string) (string, bool, []string, error)
ConsumeUnparsedValue parses the given args for a matching option. If found, the option and value is removed from args. The string value of the option, a boolean indicating if the option was found, the possibly modified args array is returned. The function may also return an error for a malformed option. Typically a non-bool option that lacks a value.
func DeprecationIfChanged ¶ added in v2.16.0
DeprecationIfChanged will print a deprecation warning on output.Info if the flag has changed.
Use this method instead of the standard pflag deprecation to ensure that the deprecation message doesn't clobber JSON output.
func GetUnparsedBoolean ¶ added in v2.13.0
GetUnparsedBoolean returns the value of a boolean flag that has been provided after a "--" on the command line, and hence hasn't been parsed as a normal flag. Typical use case is:
telepresence intercept --docker-run ... -- --rm
func GetUnparsedValue ¶
func GetUnparsedValue(longForm string, shortForm byte, isBool bool, args []string) (string, bool, error)
GetUnparsedValue parses the given args for a matching option. The string value of the option and a boolean indicating if the option was found. The function may also return an error for a malformed option. Typically a non-bool option that lacks a value.
Types ¶
This section is empty.