cli

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitSuccess            = 0
	ExitGenericFailure     = 1
	ExitVerificationFailed = 2
	ExitAuthError          = 3
	ExitProtocolError      = 4
	ExitNotFound           = 5
)

Exit codes per CLI contract.

Variables

This section is empty.

Functions

func AddCommands

func AddCommands(root *cobra.Command, cfg *config.Config)

AddCommands attaches all subcommands to the root.

func ExitCode

func ExitCode(err error) int

ExitCode returns the exit code from err if it is an ExitError, else ExitGenericFailure.

func NewRootCmd

func NewRootCmd(cfg *config.Config) *cobra.Command

NewRootCmd creates the root cobra command.

Types

type ExitError

type ExitError struct {
	Code int
	Err  error
}

ExitError carries an exit code for main to use. Only main() may call os.Exit.

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

Jump to

Keyboard shortcuts

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