utils

package
v0.0.0-...-cfe2362 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AliasCommand

func AliasCommand(command string) func(cmd *cobra.Command, args []string)

func AliasCommandArgpos

func AliasCommandArgpos(command string, argpos ...int) func(cmd *cobra.Command, args []string)

func AskString

func AskString(prompt string, hidden bool) string

func FindContext

func FindContext(cmd *cobra.Command) context.Context

func GetStringFlag

func GetStringFlag(cmd *cobra.Command, name string, defaultValue string) string

func RunBash

func RunBash(command string, args ...any)

func RunBashReturn

func RunBashReturn(command string, args ...any) ([]byte, error)

func StringSliceToAnySlice

func StringSliceToAnySlice(args []string) []any

func SudoIfNotRoot

func SudoIfNotRoot(command string) string

Types

type CommandGroup

type CommandGroup struct {
	Command  *cobra.Command
	Children []func(*cobra.Command)
}

func (*CommandGroup) Register

func (c *CommandGroup) Register(root *cobra.Command)

func (*CommandGroup) RegisterChildren

func (c *CommandGroup) RegisterChildren()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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