cobra

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandIsSubCommandOf added in v0.10.1

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 added in v0.10.1

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 added in v0.10.1

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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