A view is not a missing port: show interfaces <keyword> #1444

Merged
jaylouisw merged 1 commit from fix/show-interfaces-view-keywords into main 2026-11-12 00:22:54 +00:00
Owner

Closes #1443

Twelve words that are views under show interfaces in IOS answered % No interface <word> on <box> — the same sentence a mistyped port name gets — and show interfaces ? answered % No interface ? on <box>.

s1> show interfaces switchport
% No interface switchport on Switch (L2)-s1        <- "the port is missing", about a word that is a view
s1> show interfaces ?
% No interface ? on Switch (L2)-s1                 <- the answer to "what may I type here?"

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

input before now
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 … unchanged
show interfaces Fa0/1 the port block unchanged

The 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:

  • The port table is asked first. A device with a port genuinely called status still prints that port; the keyword table is consulted only after the name resolves to nothing.
  • Every command the advice names is run by the test. show vlan brief, show version, show lldp neighbors and show interfaces <port> are executed and required to answer — advice that does not run is another way of wasting the reader's time.
  • Only the twelve view words take the new path. A near-miss on a real port name keeps the % No interface … sentence, so the port complaint never loses its meaning.

No view was invented: this is the existing show interfaces door 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, ?/help print 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.js fails 60 of 71. Neighbouring suites all green: show-argument-refusal 77, show-interfaces-port 38, iface-name-agreement 16, iface-alias 17, help-completeness 3, show-access-lists 23, show-arp 28, show-lldp 23, show-vlan 29, spec-vs-description 3.

Docs: docs/ARCHITECTURE.md § "No such port was the answer to a question about a view".

Closes #1443 Twelve words that are views under `show interfaces` in IOS answered `% No interface <word> on <box>` — the same sentence a mistyped port name gets — and `show interfaces ?` answered `% No interface ? on <box>`. ``` s1> show interfaces switchport % No interface switchport on Switch (L2)-s1 <- "the port is missing", about a word that is a view s1> show interfaces ? % No interface ? on Switch (L2)-s1 <- the answer to "what may I type here?" ``` 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 | input | before | now | | --- | --- | --- | | `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 <port>\`; VLAN membership is in \`show vlan brief\`.` | | `show interfaces ?` / `… help` | `% No interface ? on …` | `% Usage: \`show interfaces\` lists every port; \`show interfaces <port>\` 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 …` | unchanged | | `show interfaces Fa0/1` | the port block | unchanged | The 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: * **The port table is asked first.** A device with a port genuinely called `status` still prints that port; the keyword table is consulted only after the name resolves to nothing. * **Every command the advice names is run by the test.** `show vlan brief`, `show version`, `show lldp neighbors` and `show interfaces <port>` are executed and required to answer — advice that does not run is another way of wasting the reader's time. * **Only the twelve view words take the new path.** A near-miss on a real port name keeps the `% No interface …` sentence, so the port complaint never loses its meaning. No view was invented: this is the existing `show interfaces` door 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, `?`/`help` print 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.js` fails **60 of 71**. Neighbouring suites all green: `show-argument-refusal` 77, `show-interfaces-port` 38, `iface-name-agreement` 16, `iface-alias` 17, `help-completeness` 3, `show-access-lists` 23, `show-arp` 28, `show-lldp` 23, `show-vlan` 29, `spec-vs-description` 3. Docs: `docs/ARCHITECTURE.md` § *"No such port was the answer to a question about a view"*.
A view is not a missing port: show interfaces <keyword> (#1443)
All checks were successful
CI / Classify the change (pull_request) Successful in 11s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 15s
CI / Test (Node 20) (pull_request) Successful in 2m50s
CI / Test (Node 18) (pull_request) Successful in 3m2s
CI / Server smoke test (pull_request) Successful in 26s
CI / Docker build (pull_request) Successful in 40s
CI / Test (Node 22) (pull_request) Successful in 2m44s
b50643aee2
Twelve words that are views under 'show interfaces' in IOS answered
'% No interface <word> on <box>' - the sentence a mistyped port name gets -
and 'show interfaces ?' answered '% No interface ? on <box>'.

  s1> show interfaces switchport
  % No interface switchport on Switch (L2)-s1

The port is fine; the view is not here. 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 - and the one question whose whole purpose is
"what may I type here?" got an error about a port called '?'.

The words live in one table, INTERFACES_VIEW_KEYWORDS, each entry saying where
the question IS answered (show vlan brief, show interfaces <port>,
show version). A view word is now reported as a view and points there; '?' and
'help' print a usage line; a genuine near-miss on a port name keeps the old
sentence; and the port table is asked first, so a port named like a keyword
still wins. Every command the advice names is executed by the test - advice
that does not run is another way of wasting the reader's time.

Evidence: test/show-interfaces-view-keywords.test.js, 71 checks; reverting
engine/cli.js fails 60 of them. Suite 222 suites, 8329 assertions, 0 failed.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-12 00:22:51 +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!1444
No description provided.