Documentation ¶
Index ¶
- func CommandIsSubCommandOf(cmd *cobra.Command, subCommandString string) bool
- func CommandIsSubCommandOfOneOrMore(cmd *cobra.Command, subCommandStrings []string) bool
- func FullCommandString(cmd *cobra.Command) string
- func FullCommandStringWithoutPrefix(cmd *cobra.Command, prefix string) string
- func VisitAllCommands(cmd *cobra.Command, fn func(*cobra.Command))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandIsSubCommandOf ¶
CommandIsSubCommandOf detects if a command is a subcommand (or command) or a given command string Example: CommandIsSubCommandOf(cmd, "mw docker env") returns true if cmd is a subcommand of docker env command Canonical names must be used, aliases will not work.
func FullCommandString ¶
FullCommandString for example "mw docker redis exec".
func FullCommandStringWithoutPrefix ¶
FullCommandStringWithoutPrefix removes an optional prefix from FullCommandString This can be used to, for example, remove the root command from the string with ease.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.