command

package
v0.0.0-...-94027f3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BEGIN_GAP = 2 // number of spaces before flag or available commands
View Source
const PRINT_GAP = 2 // number of spaces between flag and help text or available commands and short description

Variables

This section is empty.

Functions

func GetCmdParentsName

func GetCmdParentsName(cmd *cobra.Command) string

func ReverseStringSlice

func ReverseStringSlice(slice []string) []string

Types

type Command

type Command struct {
	*cobra.Command
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(cmd *cobra.Command) *Command

func (*Command) PrintHelpFunc

func (c *Command) PrintHelpFunc(cmd *cobra.Command, args []string)

func (*Command) PrintUsageFunc

func (c *Command) PrintUsageFunc(cmd *cobra.Command) error

func (*Command) VarsPs

func (cmd *Command) VarsPs(p any, names []string, value any, usage string, isRequire bool)

type Flag

type Flag struct {
	// contains filtered or unexported fields
}

func (*Flag) Usage

func (f *Flag) Usage() string

Usage returns the usage string for the flag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳