The spellings IOS taught, on a console that has the views under other names #1448

Merged
jaylouisw merged 1 commit from fix/show-ip-spellings into main 2026-11-12 00:48:13 +00:00
Owner

Closes #1447

show ip arp, show ip interface, show ip access-lists, show ip vrrp, show ip, show ip ? — six spellings IOS taught for thirty years, all refused with % Invalid show command: on a console that has every one of those views under another name.

s1> show ip arp
% Invalid show command: ip arp
s1> show arp
Protocol  Address          Age (min)  Hardware Addr     Interface
Internet  10.7.0.2         -          02:00:00:00:02:00 eth0

The change

spelling before now
show ip arp, show ip access-lists, show ip vrrp % Invalid show command rewritten to show arp, show access-lists, show vrrp — the same door, so the two spellings cannot drift apart
show ip interface (bare) % Invalid show command rewritten to show interfaces
show ip interface brief worked still works — not rewritten: it is a view of its own
show ip arp <address> % Invalid show command rewritten with its argument, so the reader gets the useful refusal ("the whole cache is listed")
show ip protocols, show ip traffic % Invalid show command no equivalent exists, so the refusal names the commands that do answer the question
show ip, show ip ? % Invalid show command the list of what show ip can be followed by, ending at help
show ip route <prefix>, show ip ospf neighbor, show ip nat translations, show ip dhcp binding, show ip bgp summary worked untouched: longer forms keep their own doors
show interfaces brief % No interface brief % \brief` is a view, not a port: … `show ip interface brief` is the one-line-per-port view`

Three decisions worth keeping:

  • An alias, not a second implementation. show ip arp and show arp print the same rows because they are the same code. A parallel implementation would drift within a week.
  • Only the bare form is rewritten. The obvious way to write this — map interface to interfaces wherever it appears — swallows show ip interface brief into show interfaces brief, which is not a view at all. The alias is keyed on arity; removing that guard fails the suite.
  • A refusal names a command. "Invalid" is the one thing the reader already knows.

Evidence

test/show-ip-spellings.test.js, 70 checks: every alias prints exactly what its target prints, compared row for row on a switch and on a router, with a resolved ARP row so an empty answer cannot pass (an L2 switch has no IP interface, so its own cache is empty — the router is where that is testable); arguments are carried through; show ip interface brief still differs from show ip interface; the six longer forms keep their own doors; each pointer refusal is parsed for the commands it names and every one is executed; show ip and show ip ? list every word the tables hold, and every word they promise is a command; show interfaces brief names a command that answers; the redirect is proven to run before the first branch of _show; and show arp itself is unchanged.

Reverts: removing the redirect fails 20/70, removing the arity guard fails 2/70.

Docs: docs/ARCHITECTURE.md § "The spellings IOS taught, on a console that has the views under other names".

Closes #1447 `show ip arp`, `show ip interface`, `show ip access-lists`, `show ip vrrp`, `show ip`, `show ip ?` — six spellings IOS taught for thirty years, all refused with `% Invalid show command:` on a console that has every one of those views under another name. ``` s1> show ip arp % Invalid show command: ip arp s1> show arp Protocol Address Age (min) Hardware Addr Interface Internet 10.7.0.2 - 02:00:00:00:02:00 eth0 ``` ### The change | spelling | before | now | | --- | --- | --- | | `show ip arp`, `show ip access-lists`, `show ip vrrp` | `% Invalid show command` | **rewritten** to `show arp`, `show access-lists`, `show vrrp` — the same door, so the two spellings cannot drift apart | | `show ip interface` (bare) | `% Invalid show command` | rewritten to `show interfaces` | | `show ip interface brief` | worked | still works — **not** rewritten: it is a view of its own | | `show ip arp <address>` | `% Invalid show command` | rewritten with its argument, so the reader gets the useful refusal ("the whole cache is listed") | | `show ip protocols`, `show ip traffic` | `% Invalid show command` | no equivalent exists, so the refusal names the commands that do answer the question | | `show ip`, `show ip ?` | `% Invalid show command` | the list of what `show ip` can be followed by, ending at `help` | | `show ip route <prefix>`, `show ip ospf neighbor`, `show ip nat translations`, `show ip dhcp binding`, `show ip bgp summary` | worked | untouched: longer forms keep their own doors | | `show interfaces brief` | `% No interface brief` | `% \`brief\` is a view, not a port: … \`show ip interface brief\` is the one-line-per-port view` | Three decisions worth keeping: * **An alias, not a second implementation.** `show ip arp` and `show arp` print the same rows because they are the same code. A parallel implementation would drift within a week. * **Only the bare form is rewritten.** The obvious way to write this — map `interface` to `interfaces` wherever it appears — swallows `show ip interface brief` into `show interfaces brief`, which is not a view at all. The alias is keyed on arity; removing that guard fails the suite. * **A refusal names a command.** "Invalid" is the one thing the reader already knows. ### Evidence `test/show-ip-spellings.test.js`, **70 checks**: every alias prints *exactly* what its target prints, compared row for row on a switch and on a router, with a resolved ARP row so an empty answer cannot pass (an L2 switch has no IP interface, so its own cache is empty — the router is where that is testable); arguments are carried through; `show ip interface brief` still differs from `show ip interface`; the six longer forms keep their own doors; each pointer refusal is parsed for the commands it names and every one is executed; `show ip` and `show ip ?` list every word the tables hold, and every word they promise is a command; `show interfaces brief` names a command that answers; the redirect is proven to run before the first branch of `_show`; and `show arp` itself is unchanged. Reverts: removing the redirect fails 20/70, removing the arity guard fails 2/70. Docs: `docs/ARCHITECTURE.md` § *"The spellings IOS taught, on a console that has the views under other names"*.
The spellings IOS taught, on a console that has the views under other names (#1447)
All checks were successful
CI / Classify the change (pull_request) Successful in 12s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 16s
CI / Test (Node 20) (pull_request) Successful in 3m0s
CI / Test (Node 18) (pull_request) Successful in 3m11s
CI / Server smoke test (pull_request) Successful in 30s
CI / Docker build (pull_request) Successful in 36s
CI / Test (Node 22) (pull_request) Successful in 2m47s
617d2d4639
show ip arp, show ip interface, show ip access-lists, show ip vrrp, show ip and
show ip ? all answered '% Invalid show command:' on a console that has every one
of those views under another name. show arp printed the same rows from the same
table.

A spelling whose view exists is now rewritten to that view - an alias, not a
second implementation, so the two cannot drift apart:

  * show ip arp / access-lists / vrrp -> show arp / access-lists / vrrp, with any
    argument carried through so show ip arp <address> gives the useful refusal
    that says the whole cache is listed;
  * show ip interface (bare) -> show interfaces, but NOT show ip interface brief,
    which is a view of its own: the alias is keyed on arity for that reason, and
    removing the guard fails the suite;
  * show ip protocols and show ip traffic have no equivalent, so the refusal names
    the commands that do answer the question - and the test executes every one;
  * show ip and show ip ? list what show ip can be followed by, ending at help;
  * longer forms (route <prefix>, ospf neighbor, nat translations, dhcp binding,
    bgp summary) keep their own doors.

show interfaces brief had the same problem from the other side and joins the
view-keyword table.

Evidence: test/show-ip-spellings.test.js, 70 checks; reverting engine/cli.js
fails 20, removing the arity guard fails 2. Suite 224 suites, 8425 assertions,
0 failed.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-12 00:48:09 +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!1448
No description provided.