cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0, MIT Imports: 54 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli is the command line. Each area adds its commands in a file of its own (`cmd_<area>.go`) that calls Register from init, so two areas never edit the same file.

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.0.0-dev"

Version is set at release with -ldflags "-X .../internal/cli.Version=1.2.3".

Functions

func Execute

func Execute() int

Execute runs the command line and returns the process exit code: 0, 1 for a verdict that says no, 2 for an error.

func NewRoot

func NewRoot() *cobra.Command

NewRoot builds the root command with every registered command attached.

func Register

func Register(add func(root *cobra.Command))

Register adds commands to the root when it is built. Call it from init in `cmd_<area>.go`.

func Verdict

func Verdict(format string, args ...any) error

Verdict makes the error a command returns when it ran and its answer is "no". The process then exits with status 1; any other error is the command failing, and exits with status 2, as rust-anything does.

Types

This section is empty.

Jump to

Keyboard shortcuts

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