show ? is refused as an invalid command, one word after show ip ? answers the same question #1673

Closed
opened 2026-11-16 14:42:26 +00:00 by jaylouisw · 0 comments
Owner

The reproduction

At any prompt:

Router# show ?
% Invalid show command: ?
Router# show ip ?
% `show ip` needs a view. This console has: route, interface brief, ospf, bgp, nat, dhcp, dns - and access-lists, arp, interface, vrrp, each of which reaches the `show` command of the same name.
  No equivalent here: protocols, traffic. Type `help` for the full command list.

So the operator who is unsure of the first word of a show line is told the key itself is invalid, and the one who is unsure of the second is handed the list. test/help-key-works-in-every-prompt.test.js pins ? at all five prompts, and the note over EXEC_WORDS in engine/cli.js names the two positions where this console keeps a complete table - the first word of an EXEC line, and the view word after show. The second of those is the one that refuses the key.

Why it is the table that matters, not the key

interface ?, speed ? and the rest are deliberately left alone, and the reason is written down: there is no complete list of what may stand there, so a short word cannot be told from an ambiguous one and the console does not guess. The view word after show is different - SHOW_VIEW_WORDS is that complete list, and the dispatcher already resolves abbreviations against it (sh ver, sh sp). Answering ? from the same table cannot advertise a view that show then refuses.

What should happen

show ? lists the views, from the table the dispatcher uses rather than a second copy of it, naming the aliases show port-channel summary needs (port-channel for etherchannel, run for running-config, interface for interfaces), and pointing at show ip ? for the views one word deeper. Nothing else changes: show with no word, an unknown word, and an ambiguous prefix keep the answers they have today.

## The reproduction At any prompt: ``` Router# show ? % Invalid show command: ? Router# show ip ? % `show ip` needs a view. This console has: route, interface brief, ospf, bgp, nat, dhcp, dns - and access-lists, arp, interface, vrrp, each of which reaches the `show` command of the same name. No equivalent here: protocols, traffic. Type `help` for the full command list. ``` So the operator who is unsure of the **first** word of a `show` line is told the key itself is invalid, and the one who is unsure of the **second** is handed the list. `test/help-key-works-in-every-prompt.test.js` pins `?` at all five prompts, and the note over `EXEC_WORDS` in `engine/cli.js` names the two positions where this console keeps a *complete* table - the first word of an EXEC line, and the view word after `show`. The second of those is the one that refuses the key. ## Why it is the table that matters, not the key `interface ?`, `speed ?` and the rest are deliberately left alone, and the reason is written down: there is no complete list of what may stand there, so a short word cannot be told from an ambiguous one and the console does not guess. The view word after `show` is different - `SHOW_VIEW_WORDS` is that complete list, and the dispatcher already resolves abbreviations against it (`sh ver`, `sh sp`). Answering `?` from the same table cannot advertise a view that `show` then refuses. ## What should happen `show ?` lists the views, from the table the dispatcher uses rather than a second copy of it, naming the aliases `show port-channel summary` needs (`port-channel` for `etherchannel`, `run` for `running-config`, `interface` for `interfaces`), and pointing at `show ip ?` for the views one word deeper. Nothing else changes: `show` with no word, an unknown word, and an ambiguous prefix keep the answers they have today.
Sign in to join this conversation.
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#1673
No description provided.