A command with words it cannot use refuses them (#1403) #1404

Merged
jaylouisw merged 1 commit from fix/show-argument-refusal into main 2026-11-11 00:22:33 +00:00
Owner

A command with words it cannot use refuses them. Fixes #1403.

Found by pointing every show command that takes a filter at arguments nobody implemented and asking whether the
answer changed. Twelve of fourteen did not. The worst was not an empty answer:

r1#show ip route 192.0.2.0/24
Codes: C - connected, S - static, O - OSPF, B - BGP
C   10.0.0.0       /24  is directly connected, Gi0

The table held one route, 10.0.0.0/24. The question was whether 192.0.2.0/24 was installed. The answer printed a
different prefix. An operator checking whether a prefix is installed is checking exactly the thing a silent drop
fabricates — the table came back looking like a yes.

What changed

Eleven commands now refuse a tail they cannot use, quoting the words typed and naming the command:

command was
show ip route <prefix> printed the whole table
show arp <address> printed the whole cache
show ip interface brief <port> printed every interface
show running-config [interface <port>] printed the whole configuration
show vlan <id> (and anything after brief) printed every VLAN
show spanning-tree <port> printed the whole tree
show lldp neighbors <port>, show lldp <x> printed every neighbour
show access-lists <n> printed every list
show etherchannel <x> printed the summary
show vrrp <group> printed every group
show version <x> printed the banner

Where a narrower question has an answer, the refusal names the command that gives it:

sw1#show ip interface brief Gi1/0/1
% show ip interface brief does not take "Gi1/0/1": every interface is listed - use `show interfaces Gi1/0/1` for one port

sw1#show running-config interface Gi1/0/1
% show running-config does not take "interface Gi1/0/1": the whole configuration is printed - use `show interfaces Gi1/0/1` for one port's state

Also fixed: an unknown port in the OSPF reports was described as a port that "is not carrying OSPF" — a claim
about a socket the box does not have. show ip ospf neighbor NOSUCH and show ip ospf interface NOSUCH now say
% No interface NOSUCH on <device>, the sentence the rest of the console uses.

Two kinds of answer are deliberately not refusals, and the suite asserts the difference: a device-level fact that
holds whatever was typed (% No access lists configured; a box that cannot supply power says so about the device),
and % No interface X on <device>, which is the answer to the words rather than a refusal of them.

Evidence

test/show-argument-refusal.test.js — 77 checks. The lab has content in every table (a routed prefix, an ARP
neighbour, a MAC entry, an OSPF process), so a drop is visible; each of the twelve refusals quotes the words typed,
names the command, and is one line rather than a table with a sentence on top; every documented form still answers;
the two commands that really do filter (show interfaces <port>, show mac address-table interface <port>, #1401)
still filter and still refuse unknown ports by name; the OSPF sentence on all three shapes (unknown port, real port,
whole process); and a sweep over the documented show surface asserting nothing silently drops a tail.

Reverting engine/cli.js fails 50 of the 77.

docs/CLI.md: a new section, "A command with words it cannot use refuses them", with the fabricated-yes example.

Suite: 204 suites, 7,854 assertions, 0 failed. Syntax: 272 files, OK.

A command with words it cannot use refuses them. Fixes #1403. Found by pointing every `show` command that takes a filter at arguments nobody implemented and asking whether the answer changed. **Twelve of fourteen did not.** The worst was not an empty answer: ``` r1#show ip route 192.0.2.0/24 Codes: C - connected, S - static, O - OSPF, B - BGP C 10.0.0.0 /24 is directly connected, Gi0 ``` The table held one route, `10.0.0.0/24`. The question was whether `192.0.2.0/24` was installed. The answer printed a different prefix. An operator checking whether a prefix is installed is checking exactly the thing a silent drop fabricates — the table came back looking like a yes. ## What changed Eleven commands now refuse a tail they cannot use, quoting the words typed and naming the command: | command | was | |---|---| | `show ip route <prefix>` | printed the whole table | | `show arp <address>` | printed the whole cache | | `show ip interface brief <port>` | printed every interface | | `show running-config [interface <port>]` | printed the whole configuration | | `show vlan <id>` (and anything after `brief`) | printed every VLAN | | `show spanning-tree <port>` | printed the whole tree | | `show lldp neighbors <port>`, `show lldp <x>` | printed every neighbour | | `show access-lists <n>` | printed every list | | `show etherchannel <x>` | printed the summary | | `show vrrp <group>` | printed every group | | `show version <x>` | printed the banner | Where a narrower question has an answer, the refusal names the command that gives it: ``` sw1#show ip interface brief Gi1/0/1 % show ip interface brief does not take "Gi1/0/1": every interface is listed - use `show interfaces Gi1/0/1` for one port sw1#show running-config interface Gi1/0/1 % show running-config does not take "interface Gi1/0/1": the whole configuration is printed - use `show interfaces Gi1/0/1` for one port's state ``` **Also fixed:** an unknown port in the OSPF reports was described as a port that "is not carrying OSPF" — a claim about a socket the box does not have. `show ip ospf neighbor NOSUCH` and `show ip ospf interface NOSUCH` now say `% No interface NOSUCH on <device>`, the sentence the rest of the console uses. Two kinds of answer are deliberately **not** refusals, and the suite asserts the difference: a device-level fact that holds whatever was typed (`% No access lists configured`; a box that cannot supply power says so about the device), and `% No interface X on <device>`, which is the answer to the words rather than a refusal of them. ## Evidence `test/show-argument-refusal.test.js` — **77 checks**. The lab has content in every table (a routed prefix, an ARP neighbour, a MAC entry, an OSPF process), so a drop is visible; each of the twelve refusals quotes the words typed, names the command, and is one line rather than a table with a sentence on top; every documented form still answers; the two commands that really do filter (`show interfaces <port>`, `show mac address-table interface <port>`, #1401) still filter and still refuse unknown ports by name; the OSPF sentence on all three shapes (unknown port, real port, whole process); and a sweep over the documented `show` surface asserting nothing silently drops a tail. Reverting `engine/cli.js` fails **50 of the 77**. `docs/CLI.md`: a new section, "A command with words it cannot use refuses them", with the fabricated-yes example. Suite: **204 suites, 7,854 assertions, 0 failed**. Syntax: 272 files, OK.
A command with words it cannot use refuses them (#1403)
Some checks failed
CI / Classify the change (pull_request) Successful in 9s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 11s
CI / Test (Node 20) (pull_request) Successful in 2m53s
CI / Test (Node 18) (pull_request) Successful in 3m3s
CI / Server smoke test (pull_request) Successful in 27s
CI / Docker build (pull_request) Successful in 40s
CI / Test (Node 22) (pull_request) Failing after 2m30s
adb3aa72b6
Found by pointing every `show` command that takes a filter at arguments nobody implemented and asking whether the
answer changed. Twelve of fourteen did not. The worst was not an empty answer:

    r1#show ip route 192.0.2.0/24
    Codes: C - connected, S - static, O - OSPF, B - BGP
    C   10.0.0.0       /24  is directly connected, Gi0

The table held one route, 10.0.0.0/24; the question was whether 192.0.2.0/24 was installed; the answer printed a
different prefix. An operator checking whether a prefix is installed is checking exactly the thing a silent drop
fabricates - the table came back looking like a yes.

Fixed: eleven commands now refuse a tail they cannot use, quoting the words and naming the command:

* `show ip route <prefix>`, `show arp <address>`, `show ip interface brief <port>`, `show running-config
  interface <port>` / any tail, `show vlan <id>` (and anything after `brief`), `show spanning-tree <port>`,
  `show lldp neighbors <port>` / `show lldp <x>`, `show access-lists <n>`, `show etherchannel <x>`,
  `show vrrp <group>`, `show version <x>`.

Where a narrower question has an answer, the refusal names the command that gives it: `% show ip interface brief
does not take "Gi1/0/1": every interface is listed - use `show interfaces Gi1/0/1` for one port`.

Also: an unknown port in the OSPF reports was described as a port that "is not carrying OSPF" - a claim about a
socket the box does not have. `show ip ospf neighbor NOSUCH` and `show ip ospf interface NOSUCH` now say
`% No interface NOSUCH on <device>`, the sentence the rest of the console uses.

Two kinds of answer are deliberately not refusals, and the suite asserts the difference: a device-level fact that
holds whatever was typed (`% No access lists configured`; a box that cannot supply power says so about the device),
and `% No interface X on <device>`, which is the answer to the words rather than a refusal of them.

Evidence: test/show-argument-refusal.test.js, 77 checks - the lab has content in every table so a drop is visible;
each of the twelve refusals quotes the words typed, names the command and is one line rather than a table with a
sentence on top; every documented form still answers; the two real filters (`show interfaces <port>`,
`show mac address-table interface <port>`) still filter and still refuse unknown ports by name; the OSPF sentence;
and a sweep over the documented `show` surface asserting nothing silently drops a tail. Reverting engine/cli.js
fails 50 of the 77.

docs/CLI.md: a new section, "A command with words it cannot use refuses them", with the fabricated-yes example.

Suite: 204 suites, 7,854 assertions, 0 failed. Syntax: 272 files, OK.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-11 00:22:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1404
No description provided.