A view is not a missing port: show interfaces <keyword> #1444
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!1444
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/show-interfaces-view-keywords"
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 #1443
Twelve words that are views under
show interfacesin IOS answered% No interface <word> on <box>— the same sentence a mistyped port name gets — andshow interfaces ?answered% No interface ? on <box>.The port is fine. The view is not here, and the answer taught the wrong lesson: an operator who typed a command they know from IOS was told a socket did not exist, so the next thing they check is a port name that was never wrong.
The change
show interfaces switchport(and 11 more)% No interface switchport on …% \switchport` is a view, not a port: this console has no `show interfaces switchport`. A port's own switchport line is in `show interfaces `; VLAN membership is in `show vlan brief`.`show interfaces ?/… help% No interface ? on …% Usage: \show interfaces` lists every port; `show interfaces ` prints one. There is no keyword form here - `help` lists the commands this console has, `show vlan` prints VLAN membership and `show lldp neighbors` prints what is plugged in.`show interfaces Fa0/9x% No interface Fa0/9x on …show interfaces Fa0/1The words are one named table —
INTERFACES_VIEW_KEYWORDS— each entry saying where the question is answered:switchport,trunk,status,description,counters,summary,capabilities,transceiver,errdisable,flowcontrol,history,stats.Three rules kept:
statusstill prints that port; the keyword table is consulted only after the name resolves to nothing.show vlan brief,show version,show lldp neighborsandshow interfaces <port>are executed and required to answer — advice that does not run is another way of wasting the reader's time.% No interface …sentence, so the port complaint never loses its meaning.No view was invented: this is the existing
show interfacesdoor telling the truth about what it has.Evidence
test/show-interfaces-view-keywords.test.js, 71 checks: each word is named as a view and never as a missing port, the offered commands are executed, bogus and real ports answer exactly as before,?/helpprint usage, case does not matter, the words live in one table the console asks, and the keyword check sits after the port lookup in the source (checked statically, so a port named like a keyword keeps winning).Reverting
engine/cli.jsfails 60 of 71. Neighbouring suites all green:show-argument-refusal77,show-interfaces-port38,iface-name-agreement16,iface-alias17,help-completeness3,show-access-lists23,show-arp28,show-lldp23,show-vlan29,spec-vs-description3.Docs:
docs/ARCHITECTURE.md§ "No such port was the answer to a question about a view".