cli

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 40 Imported by: 2 modules, 4 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 Corbie's command line. Everything it does to a run it does through the client package, so one act gives one answer in one set of words however it is asked for.

Index

Constants

This section is empty.

Variables

View Source
var Commands []Command

Commands is the one table of commands.

View Source
var Version = "0.2.1"

Version is which Corbie this is.

Functions

func Main

func Main(args []string, in io.Reader, out, errOut io.Writer) int

Main runs the command line and gives its exit status: 0 for success, 2 for a mistake in how the command was written, 1 for failure.

func Pages

func Pages() map[string]string

Pages gives a page of the manual for each command, made from the table.

func Run

func Run(ctx context.Context, args []string, in io.Reader, out, errOut io.Writer) int

Run is Main under a context.

Types

type Checked

type Checked struct {
	OK   bool  `json:"ok"`
	Legs []Leg `json:"legs"`
	// Run is the check's run, when it did not go as it should.
	Run *client.Run `json:"run,omitzero"`
}

A Checked is what a check found.

type Command

type Command struct {
	Name    string // as it is typed: "submit", "controller enrol"
	Usage   string // what follows the name
	Summary string // one line
	Help    string // the rest of its page
	// Stays says the command stays until a run ends, or until stopped.
	Stays bool
	// contains filtered or unexported fields
}

A Command is one command of the binary. The commands, their help, the manual's pages about them and the names by which a model is allowed to run them all come from the one table of these.

func Find

func Find(args []string) (*Command, []string)

Find gives the command a command line names, as the one reading of it.

type Leg

type Leg struct {
	Leg     string  `json:"leg"`
	Status  string  `json:"status"` // ok, late or never
	Seconds float64 `json:"seconds,omitzero"`
	Why     string  `json:"why,omitzero"`
}

A Leg is one thing the check's run needed, and what became of it.

Jump to

Keyboard shortcuts

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