Three command families swallowed a word they did not understand #1496
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1496
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/word-audit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The question
Three handlers answering a neighbouring command's question (#1493) suggested a wider one: what does each command family do when it is handed a word that does not exist? Thirty-three families, one nonsense word each, every answer sorted into three classes:
3 silent, 16 unquoted, 31 good. The silent ones were the real finds.
1.
channel-group flurbishcreated a channel group called "flurbish"and in configuration:
The mode was validated —
channel-group 5 mode flurbishanswers% Invalid mode: flurbish— and the id was not. So a typo became configuration, with a receipt:show etherchannellists a group whose id is a word, and no other port can ever join it. This is the same failure as the VLAN-id doors that once answeredVLAN NaN created (name: VLAN0NaN), in the one door that was left open.2.
shutdown flurbishclosed the port and said nothingThe extra word was ignored and the port went down — a typo that costs a link with no witness at all. Same on a router port.
Both now refuse, quote the word, and change nothing:
3.
ip route flurbishwas reported as a missing argumentThat sends the reader to add a mask to something that is not an address. The shape of the destination is now checked before the rest of the line:
A genuinely short line is still called incomplete — the two answers are now different because the two problems are.
The sixteen unquoted answers are left alone, deliberately
duplex flurbish→% Usage: duplex auto | full | half;switchport flurbishon a router →% ... cannot switch frames: it has no l2-forward capability;clock rate flurbishon an RJ45 port →% clock rate is only configurable on a serial interface. None names the word, and all three tell the reader what to do instead — the alternatives, or the capability that is missing. That distinction is now written down as a rule in the test rather than left to judgement: an unquoted refusal must name a capability or list the alternatives.Evidence
test/no-command-swallows-a-word.test.js— the sweep as a guard: 33 families, three classes, the rule above, plus "no refused command wrote configuration". 21 checks, 21 passed / 0 failed. With the old handler: 12 passed / 9 failed, naming both silent families and the misleading route answer.Those flat assertions also pin what must not regress:
channel-group 5 mode activestill bundles the port and records group 5,shutdownalone still closes the port,no shutdownstill opens it, a valid route is installed and stored, a non-contiguous mask is still refused with its reason, andchannel-group 5 mode flurbishstill names the mode.Docs:
docs/CLI.md, new section "A word the console does not know is never swallowed".Full suite: 245 suites, 9,091 assertions, 0 failed. Syntax 314 files.
channel-group flurbishcreated a channel group, andshutdown flurbishclosed the port #1495