Documentation
¶
Overview ¶
Package cmd is preen's command line surface. It parses arguments, wires the engine, and renders results; every decision and guardrail lives in the engine packages so the CLI stays a thin shell over them.
Index ¶
Constants ¶
const ( // CodeOK means the run completed, or help or version was served. CodeOK = 0 // CodeErr covers failures with no more specific code. CodeErr = 1 // CodeNoRepo means the working directory is not inside a git repository. CodeNoRepo = 2 // CodeRepoState means a rebase, merge, or cherry-pick is in progress. CodeRepoState = 3 // CodeNothingToDo means the tree was clean and nothing needed redoing. CodeNothingToDo = 4 // CodeInvalidPlan means the plan did not account for the tree exactly once, // or a --grouping answer was stale or named something not in the tree. CodeInvalidPlan = 5 // CodeGateFailed means the gate command failed and the run was rolled back. CodeGateFailed = 6 // CodeContentChanged means the conservation check failed and the run was // rolled back. It is the code that should never appear. CodeContentChanged = 7 // CodeAborted means the user declined the plan. CodeAborted = 8 )
Exit codes. Each failure mode gets its own code so a script can tell a rolled-back run from a rejected plan without parsing output.
Variables ¶
var ( // ErrUsage reports invalid arguments. ErrUsage = errors.New("invalid arguments") // ErrAborted reports that the user declined the plan, which is a normal // outcome rather than a failure worth a message. ErrAborted = errors.New("aborted") // ErrNoBackups reports that no recovery ref exists to restore from. ErrNoBackups = errors.New("no preen backups in this repository") )
Sentinel errors for the command line surface.
var Version = ""
Version is the CLI version, set by the release build with -ldflags "-X github.com/dcadolph/preen/v2/cmd.Version=<v>". When it is empty, version falls back to the module version go install records.
Functions ¶
Types ¶
This section is empty.