cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package cli wires cobra commands to the engine (local mode) or to a running branchd via the REST API (server mode: --server / PGOVERLAY_SERVER). Engine construction is lazy (inside RunE) so --help and tests never touch Docker.

Index

Constants

View Source
const (
	ExitError = 1
	// ExitDrift: `pgb doctor` computed the plan and found drift.
	ExitDrift = 1
	// ExitDoctorFailed: `pgb doctor` could not compute the plan (branchd
	// unreachable, bad token, bad flags), so it cannot say whether there is
	// drift.
	ExitDoctorFailed = 2
)

Process exit statuses (see ExitCode). Every command exits ExitError on failure, except `pgb doctor`, which separates drift from not knowing.

Variables

This section is empty.

Functions

func ExitCode

func ExitCode(cmd *cobra.Command, err error) int

ExitCode maps the command that ran and the error it returned (as from cobra's ExecuteC) to the process exit status. Drift is ExitDrift; any other failure is ExitError unless the command sets exitOnErrorAnnotation.

func NewRootCmd

func NewRootCmd() *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

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