cmd

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package cmd wires together all mgr subcommands into a urfave/cli app.

Index

Constants

View Source
const (
	NameLabel   = "NAME"
	VCSLabel    = "VCS"
	RefLabel    = "REF"
	MSGLabel    = "MSG"
	StatusLabel = "STATUS"
)

Variables

View Source
var ErrReposFailed = errors.New("repos failed")

ErrReposFailed marks a run where the command executed but failed in at least one repo. main maps it to exit code 1 (vs 2 for usage/config errors) and must not re-print it: dispatchSummary already reported the failures on stderr.

Functions

func NewApp

func NewApp() *cli.Command

NewApp builds the root CLI application without a "--" tail or config aliases. Callers that execute user argv should use NewAppForArgs.

func NewAppForArgs added in v0.12.0

func NewAppForArgs(args []string) (*cli.Command, []string)

NewAppForArgs prepares the app for raw argv: it splits off the verbatim "--" tail (see SplitDashTail) and registers config aliases as top-level commands. The alias load honors -c/--config and is best-effort — config errors are reported later by the command actions. Returns the app and the argv head to pass to Run.

func SplitDashTail added in v0.12.0

func SplitDashTail(args []string) ([]string, []string)

SplitDashTail splits raw argv at the first standalone "--": the head is passed to the CLI parser, the tail is delivered verbatim to commands that spawn subprocesses (git, jj, shell). urfave/cli strips the separator during parsing, which would let repo names inside the command be mistaken for scope; splitting before parsing keeps the tail untouched. The tail is nil when there is no separator. Completion invocations (last arg is the hidden completion flag) pass through unchanged so completion after "--" keeps working.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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