cobrautil

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskFlagInput

func AskFlagInput(cmd *cobra.Command, flag *pflag.Flag) error

AskFlagInput prompts the user for input for a specific flag of a Cobra command.

func FindSubCommand

func FindSubCommand(cmd *cobra.Command, cmdSearchName string) (*cobra.Command, bool)

FindSubCommand searches for a sub-command within a Cobra command.

func GetNonProvidedLocalFlags

func GetNonProvidedLocalFlags(cmd *cobra.Command) []*pflag.Flag

GetNonProvidedLocalFlags retrieves flags that have not been provided for a Cobra command.

func GetSubCommands

func GetSubCommands(cmd *cobra.Command, cmdsToHide []string) ([]string, map[string]func(*cobra.Command, []string))

GetSubCommands retrieves sub-commands and hides the ones specified.

func MultiselectRemainingFlags

func MultiselectRemainingFlags(cmd *cobra.Command) (map[string]*pflag.Flag, []string)

MultiselectRemainingFlags presents an interactive multiselect for remaining flags and returns selected ones.

func MultiselectSubcommands

func MultiselectSubcommands(cmd *cobra.Command, args []string, commandsList []string, commandsMap map[string]func(*cobra.Command, []string)) (err error)

MultiselectSubcommands presents an interactive selection of available sub-commands and executes the chosen one.

func RunCommandAsPalette

func RunCommandAsPalette(cmd *cobra.Command, args []string, cmdSearchName string, cmdsToHide []string) error

RunCommandAsPalette allows the user to run a subcommand

Types

This section is empty.

Jump to

Keyboard shortcuts

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