Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Standard streams, redirected for testing. Stdin io.Reader = os.Stdin Stdout io.Writer = os.Stdout Stderr io.Writer = os.Stderr // overridden for testing ReadPassword = term.ReadPassword )
View Source
var ( HelpHeader = strings.TrimSpace(` {{.DisplayName}} lets you control services and perform management actions on the system that is running them. `) Set the PEBBLE environment variable to override the configuration directory (which defaults to {{.DefaultDir}}). Set PEBBLE_SOCKET to override the unix socket used for the API (defaults to $PEBBLE/.pebble.socket). `) )
View Source
var ErrExtraArgs = fmt.Errorf("too many arguments for command")
ErrExtraArgs is returned if extra arguments to a command are found
View Source
var HelpCategories = []HelpCategory{{ Label: "Run", Description: "run the service manager", Commands: []string{"run"}, }, { Label: "Info", Description: "help and version information", Commands: []string{"help", "version"}, }, { Label: "Plan", Description: "view and change configuration", Commands: []string{"add", "plan"}, }, { Label: "Services", Description: "manage services", Commands: []string{"services", "logs", "start", "restart", "signal", "stop", "replan"}, }, { Label: "Checks", Description: "manage health checks", Commands: []string{"checks", "health"}, }, { Label: "Files", Description: "work with files and execute commands", Commands: []string{"push", "pull", "ls", "mkdir", "rm", "exec"}, }, { Label: "Changes", Description: "manage changes and their tasks", Commands: []string{"changes", "tasks"}, }, { Label: "Notices", Description: "manage notices and warnings", Commands: []string{"warnings", "okay", "notices", "notice", "notify"}, }}
HelpCategories helps us by grouping commands
Functions ¶
func Parser ¶
func Parser(opts *ParserOptions) *flags.Parser
Parser creates and populates a fresh parser. Since commands have local state a fresh parser is required to isolate tests from each other.
func Run ¶
func Run(options *RunOptions) error
Types ¶
type CmdInfo ¶
type CmdInfo struct { // Name of the command Name string // Summary is a single-line help string that will be displayed // in the full Pebble help manual (i.e. help --all) Summary string // Description contains exhaustive documentation about the command, // that will be reflected in the specific help manual for the // command, and in the Pebble man page. Description string // New is a function that creates a new instance of the command. New func(*CmdOptions) flags.Commander // ArgsHelp (optional) contains help about the command-line arguments // (including options) supported by the command. // // map[string]string{ // "--long-option": "my very long option", // "-v": "verbose output", // "<change-id>": "named positional argument" // } ArgsHelp map[string]string // Whether to pass all arguments after the first non-option as remaining // command line arguments. This is equivalent to strict POSIX processing. PassAfterNonOption bool // When set, the command will be a subcommand of the `debug` command. Debug bool }
CmdInfo holds information needed by the CLI to execute commands and populate entries in the help manual.
type CmdOptions ¶
type CmdOptions struct { Client *client.Client Parser *flags.Parser PebbleDir string SocketPath string }
CmdOptions exposes state made accessible during command execution.
type HelpCategory ¶
type ParserOptions ¶ added in v1.10.0
Source Files ¶
- cli.go
- cmd_add.go
- cmd_autostart.go
- cmd_changes.go
- cmd_checks.go
- cmd_debug.go
- cmd_enter.go
- cmd_exec.go
- cmd_health.go
- cmd_help.go
- cmd_logs.go
- cmd_ls.go
- cmd_mkdir.go
- cmd_notice.go
- cmd_notices.go
- cmd_notify.go
- cmd_okay.go
- cmd_plan.go
- cmd_pull.go
- cmd_push.go
- cmd_replan.go
- cmd_restart.go
- cmd_rm.go
- cmd_run.go
- cmd_services.go
- cmd_signal.go
- cmd_start.go
- cmd_stop.go
- cmd_version.go
- cmd_warnings.go
- copyfs.go
- format.go
- last.go
- times.go
- wait.go
Click to show internal directories.
Click to hide internal directories.