cliutils

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BashCompleteWithError

func BashCompleteWithError[F ~func(context.Context, *cli.Command) T, T error](f F) cli.ShellCompleteFunc

func EnsureIsPrivilegedGroupMemberOrRoot added in v0.0.28

func EnsureIsPrivilegedGroupMemberOrRoot() error

func ExitIfCantDropCapsToBuilderUser added in v0.0.28

func ExitIfCantDropCapsToBuilderUser() cli.ExitCoder

ExitIfCantDropCapsToBuilderUser attempts to drop capabilities to the already running user. Returns a cli.ExitCoder with an error if the operation fails. See also ExitIfCantDropCapsToBuilderUserNoPrivs for a version that also applies no-new-privs.

func ExitIfCantDropCapsToBuilderUserNoPrivs added in v0.0.28

func ExitIfCantDropCapsToBuilderUserNoPrivs() cli.ExitCoder

ExitIfCantDropCapsToBuilderUserNoPrivs combines ExitIfCantDropCapsToBuilderUser with ExitIfCantSetNoNewPrivs

func ExitIfCantDropGidToStapler added in v0.0.28

func ExitIfCantDropGidToStapler() cli.ExitCoder

func ExitIfCantSetNoNewPrivs added in v0.0.28

func ExitIfCantSetNoNewPrivs() cli.ExitCoder

func ExitIfRootCantDropCapsNoPrivs added in v0.0.28

func ExitIfRootCantDropCapsNoPrivs() cli.ExitCoder

func FormatCliExit

func FormatCliExit(msg string, err error) cli.ExitCoder

func FormatCliExitWithCode

func FormatCliExitWithCode(msg string, err error, exitCode int) cli.ExitCoder

func GetAppCliTemplate

func GetAppCliTemplate() string

func GetCommandHelpTemplate

func GetCommandHelpTemplate() string

func GetMultiSelectQuestionTemplate added in v0.0.28

func GetMultiSelectQuestionTemplate() string

func GetSubcommandHelpTemplate added in v0.0.27

func GetSubcommandHelpTemplate() string

func HandleExitCoder

func HandleExitCoder(ctx context.Context, c *cli.Command, err error)

func Localize added in v0.0.27

func Localize(app *cli.Command)

Make the application more internationalized

Types

type BashCompleteWithErrorFunc

type BashCompleteWithErrorFunc func(ctx context.Context, c *cli.Command) error

Source Files

  • cli.go
  • localize.go
  • template.go
  • utils.go

Jump to

Keyboard shortcuts

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