The spellings IOS taught, on a console that has the views under other names #1448
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!1448
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/show-ip-spellings"
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?
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.The change
show ip arp,show ip access-lists,show ip vrrp% Invalid show commandshow arp,show access-lists,show vrrp— the same door, so the two spellings cannot drift apartshow ip interface(bare)% Invalid show commandshow interfacesshow ip interface briefshow ip arp <address>% Invalid show commandshow ip protocols,show ip traffic% Invalid show commandshow ip,show ip ?% Invalid show commandshow ipcan be followed by, ending athelpshow ip route <prefix>,show ip ospf neighbor,show ip nat translations,show ip dhcp binding,show ip bgp summaryshow 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:
show ip arpandshow arpprint the same rows because they are the same code. A parallel implementation would drift within a week.interfacetointerfaceswherever it appears — swallowsshow ip interface briefintoshow interfaces brief, which is not a view at all. The alias is keyed on arity; removing that guard fails the suite.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 briefstill differs fromshow 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 ipandshow ip ?list every word the tables hold, and every word they promise is a command;show interfaces briefnames a command that answers; the redirect is proven to run before the first branch of_show; andshow arpitself 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".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.