package
0.1.20
Repository: https://github.com/vanadium/go.lib.git
Documentation: pkg.go.dev

# Packages

Command gendoc generates godoc comments describing the usage of tools based on the cmdline package.

# Functions

EnvFromOS returns a new environment based on the operating system.
ExitCode returns the exit code corresponding to err.
HideGlobalFlagsExcept hides global flags from the default compact-style usage message, except for the given regexps.
Main implements the main function for the command tree rooted at root.
Parse parses args against the command tree rooted at root down to a leaf command.
ParseAndRun is a convenience that calls Parse, and then calls Run on the returned runner with the given env and parsed args.

# Constants

ErrUsage indicates an error in command usage; e.g.

# Structs

Command represents a single command in a command-line program.
Env represents the environment for command parsing and running.
FlagDefinitions represents a struct containing flag variables and their associated default values as per RegisterFlagsInStruct.
Topic represents a help topic that is accessed via the help command.

# Interfaces

Runner is the interface for running commands.

# Type aliases

ErrExitCode may be returned by Runner.Run to cause the program to exit with a specific error code.
RunnerFunc is an adapter that turns regular functions into Runners.