Documentation ¶
Overview ¶
Package cli provides helper functions around command line interface
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixDeprecatedFlags ¶
FixDeprecatedFlags transforms args so that they are conforming to the new CLI structure: - replace non-posix flags posix flags - replace deprecated flags with their command equivalents - display warnings when deprecated flags are encountered
Types ¶
type ReplaceFlag ¶
ReplaceFlag structure that will hold `Args` after replacing a flags and a `Hint` of the flag that was replaced.
func ReplaceFlagPosix ¶
func ReplaceFlagPosix(arg string, flag string) ReplaceFlag
ReplaceFlagPosix replaces a single-dash flag with a POSIX flag.
type ReplaceFlagFunc ¶
type ReplaceFlagFunc func(arg string, flag string) ReplaceFlag
ReplaceFlagFunc type for a function that will produce a ReplaceFlag for the provided `arg` and `flag`.
func ReplaceFlagExact ¶
func ReplaceFlagExact(replaceWith string) ReplaceFlagFunc
ReplaceFlagExact will replace the matching flag with `replaceWith` exactly.
func ReplaceFlagSubCommandPosArg ¶
func ReplaceFlagSubCommandPosArg(replaceWith string) ReplaceFlagFunc
ReplaceFlagSubCommandPosArg replaces a subcomand sub-positional argument in the for `--foo=bar` with `--foo bar`.