Skip to main content

Module cli

Module cli 

Source
Expand description

Command-line plugins (internal/pluginhost/command_line.go).

Plugins declare flags before the main parse; the binary’s Go-rules flag parser asks Host::command_line_flag for names it does not know and records values with Host::set_command_line_flag. When any plugin flag was given, Host::execute_command_line runs the owning plugins instead of the server.

Structs§

CliFlag
One registered plugin flag (Go commandLineFlagRecord).

Enums§

Output
Output of one plugin command, in the order Go writes it.

Functions§

format_duration
Go time.Duration.String.
format_float_g
Go strconv.FormatFloat(f, 'g', -1, 64).
normalize_flag_type
Go normalizeCommandLineFlagType.
normalize_flag_value
Go normalizeCommandLineFlagValue.
parse_bool
Go strconv.ParseBool.
parse_float
Go strconv.ParseFloat(s, 64): out of range is an error rather than ±Inf, NaN takes no sign, and underscores may separate digits. ponytail: Go’s hexadecimal form (0x1p-2) is rejected; plugin flags are decimal in practice. Upgrade by porting atofHex if a plugin needs it.
valid_flag_name
Go validCommandLineFlagName.