cli: a show refusal names a command this box can run, and no table it did not print (#2146) #2147
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!2147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1119-1202"
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?
Fixes #2146
Both refusals in
_show()ended with advice about something that does not exist.show ip interface brief <word>built its pointer from the word it had just rejected:The pointer now resolves the typed words with the same
resolvePortName()theinterfacecommand uses, and carries a port only when the box has it. A word that is not a port leaves the<port>placeholder that theshow mac address-table interface <port>refusal already uses, so the sentence teaches the shape of the command instead of inventing a spelling of it.show ip interface brief Gi1/0/1still answersuseshow interfaces Gi1/0/1for one port- that pointer runs and answers.show ip route <prefix>said to read the row "in the table below", after a one-line refusal (the #1403 behaviour, unchanged) that prints no table. It now names the command that does print it:docs/CLI.mdquotes that line in "A command with words it cannot use refuses them", so the doc moves with it.Tests
test/show-argument-refusal.test.js+7 assertions: the pointer for an unknown word carries no port and keeps the placeholder; the pointer for a real port names it and is then run, and its answer is not% No interface; the route refusal neither says "table below" nor fails to nameshow ip route.node scripts/syntax-check.js- 452 files, all OKtest/show-argument-refusal.test.js- 84 passed, 0 failed (was 77)npm test- 373 suites, 12684 assertions passed, 0 failedshowrefusal names a command this box can run, and no table it did not print (#2146)