cli

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProgramName

func ProgramName() string

ProgramName returns the executable name from os.Args[0] for help and errors. Use so both "specs" and "specs-ci" show the correct branding.

Types

type Root

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

Root is the root command dispatcher (kubectl-style).

func NewRoot

func NewRoot() *Root

NewRoot returns a new root CLI.

func (*Root) Execute

func (r *Root) Execute() int

Execute parses os.Args and runs the appropriate command. Returns exit code.

func (*Root) Name

func (r *Root) Name() string

Name returns the executable name (same as ProgramName). Enables both "specs" and "specs-ci".

func (*Root) PrintHelp

func (r *Root) PrintHelp()

PrintHelp prints the main help message. Uses executable name from os.Args[0] so both "specs" and "specs-ci" show the correct branding.

func (*Root) RegisterGroup

func (r *Root) RegisterGroup(name string, subcommands map[string]Runner)

RegisterGroup registers a command group (e.g. "coverage") with subcommands.

func (*Root) RegisterTopLevel

func (r *Root) RegisterTopLevel(name string, fn Runner)

RegisterTopLevel registers a top-level command (e.g. "run", "doctor").

type Runner

type Runner func(args []string) int

Runner runs a subcommand with the given args. Returns exit code (0 = success).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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