Documentation
¶
Overview ¶
Package cliargs holds the argument-shape guards shared by the nebula-agent and nebula-mgmt entrypoints.
Go's flag package stops parsing at the first non-flag token and leaves the rest as operands. A command line with a typo where a subcommand or flag belongs therefore runs with every later flag silently dropped — `nebula-agent enrool --server URL --token TOK` used to park in standby without ever contacting the server, which reads as a server-side failure. Both binaries reject that shape without copying the unclassified value into diagnostics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Guard ¶
type Guard struct {
// contains filtered or unexported fields
}
Guard reports argument-shape errors for a single binary. The zero value is usable; New attaches the per-binary usage hint appended to every message.
func New ¶
New returns a Guard whose errors end with helpHint (e.g. "run `nebula-agent help` for usage"). An empty hint is omitted.
func (Guard) RejectPositional ¶
RejectPositional fails when flag parsing left unconsumed operands. Commands that legitimately take an operand validate NArg themselves rather than calling this.
func (Guard) UnknownCommand ¶
UnknownCommand reports an unrecognized command word. kind names what was expected — "command", "host subcommand", "service action".