Documentation
¶
Overview ¶
Package clihelp prints the flag section of a command's --help the same way for every AgentGuard binary: flags written as --flag, grouped under titles, descriptions wrapped to 80 columns, an alias on its flag's line, and a note saying how to turn off a bool flag that is on by default.
It is internal to the module: agentguard, agentguard-mcp-gateway and agentguard-llm-proxy share it, and nothing outside imports it.
Index ¶
Constants ¶
const Ungrouped = "Ungrouped"
Ungrouped is the title of the group that catches flags no group names. A help page that shows it has a flag missing from its group list.
const Width = 80
Width is the column the help wraps at.
Variables ¶
This section is empty.
Functions ¶
func Wrap ¶
Wrap splits s into lines of at most width characters, breaking at spaces. A single word longer than width gets a line of its own.
func WriteFlags ¶
WriteFlags prints every flag of fs, alphabetically, under "Flags:".
Types ¶
type Options ¶
type Options struct {
// Aliases maps an alias to the flag it stands for. The alias is printed
// on that flag's line ("--url, --guard-url string"), not on its own.
Aliases map[string]string
// HideDefault names flags whose "(default …)" note would mislead,
// because the page explains what happens when the flag isn't given.
HideDefault map[string]bool
}
Options adjusts how flags are printed.