cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 28 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 wires the provr command tree. It contains no business logic.

Index

Constants

View Source
const (
	ExitOK      = 0
	ExitRuntime = 1
	ExitUsage   = 2
)

Process exit codes.

Variables

This section is empty.

Functions

func ExitCode

func ExitCode(err error) int

ExitCode maps an error returned by command execution to an exit code.

func Run

func Run(ctx context.Context, args []string, stdout, stderr io.Writer) int

Run executes the provr CLI with args and returns the process exit code. Command output goes to stdout; errors and logs go to stderr.

Types

type ExitCodeError

type ExitCodeError struct{ Code int }

ExitCodeError makes the process exit with Code without a further message; exec uses it to propagate the remote command's exit code.

func (*ExitCodeError) Error

func (e *ExitCodeError) Error() string

type Options

type Options struct {
	ConfigPath string
	JSON       bool
	Verbose    bool
}

Options holds the values of the global flags.

func NewRoot

func NewRoot(stdout, stderr io.Writer) (*cobra.Command, *Options)

NewRoot builds the root `provr` command writing to the given streams.

type UsageError

type UsageError struct{ Err error }

UsageError marks an error caused by wrong command-line usage.

func (*UsageError) Error

func (e *UsageError) Error() string

func (*UsageError) Unwrap

func (e *UsageError) Unwrap() error

Jump to

Keyboard shortcuts

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