cobra

package
v0.25.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandIsSubCommandOf

func CommandIsSubCommandOf(cmd *cobra.Command, subCommandString string) bool

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 CommandIsSubCommandOfOneOrMore

func CommandIsSubCommandOfOneOrMore(cmd *cobra.Command, subCommandStrings []string) bool

func FullCommandString

func FullCommandString(cmd *cobra.Command) string

FullCommandString for example "mw docker redis exec".

func FullCommandStringWithoutPrefix

func FullCommandStringWithoutPrefix(cmd *cobra.Command, prefix string) string

FullCommandStringWithoutPrefix removes an optional prefix from FullCommandString This can be used to, for example, remove the root command from the string with ease.

func VisitAllCommands added in v0.12.1

func VisitAllCommands(cmd *cobra.Command, fn func(*cobra.Command))

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL