cli(show): a keyword after show is matched in any case, as a box matches it #2513

Merged
jaylouisw merged 1 commit from rev/1124-0212 into main 2026-11-24 03:08:24 +00:00
Owner

Question

Does an IOS-like box match a command's keywords in any case - and did this console?

Verdict

Known, and it was wrong here. IOS: "You can enter commands in uppercase, lowercase, or mixed case. Only passwords
are case sensitive"
and "Cisco IOS commands are generally case-insensitive"
(15.1S Configuration Fundamentals, Using the CLI); "Commands are not case-sensitive" (5900 ESW 15.2(4)GC).
This console folded the first word of a show line only: show ip ARP / show POWER INLINE reached their
views (compared lowercased), while show ip ROUTE, show ip interface BRIEF, show ip DHCP binding,
show ipv6 ND and show mac ADDRESS-TABLE were refused with % Invalid show command: ... - the sentence for a
view the console does not have - about views it does have.

Changed

  • engine/cli.js: _show() builds one lowercased copy of the line (kw) and the view branches compare through
    it (nat, interface+brief, route, dns, dhcp, ospf, bgp, ipv6 nd, mac address-table). Values are untouched.
  • test/show-keyword-case.test.js: 37 checks - eleven case variants equal their lower-case twins byte for byte,
    the real route/brief tables behind the capitalised spellings, refusals (show ip FLURB, show i) unmoved, and
    the letter of a typed value preserved in the refusal.
  • research/show-keyword-case.md: sources, before/after measurements, and what is still open (an interface
    name as opposed to the keyword; tail abbreviation; the caret sentence).
  • docs/CLI.md, CHANGELOG.md, and the tail-case bullet in research/show-incomplete-view-word.md, which had
    recorded show mac Address-Table as open.

Gates

  • node scripts/syntax-check.js - 562 files, all OK.
  • Full suite: 478 suites, 16,052 assertions, 0 failed (--concurrency=8, 288.8 s); npm test's audits
    (port types, devices, control bytes) also clean. Ledger citations checker unchanged (same 4 tolerated drift
    suspects as on main).
## Question Does an IOS-like box match a command's keywords in **any case** - and did this console? ## Verdict Known, and it was wrong here. IOS: *"You can enter commands in uppercase, lowercase, or mixed case. Only passwords are case sensitive"* and *"Cisco IOS commands are generally case-insensitive"* (15.1S Configuration Fundamentals, Using the CLI); *"Commands are not case-sensitive"* (5900 ESW 15.2(4)GC). This console folded the **first** word of a `show` line only: `show ip ARP` / `show POWER INLINE` reached their views (compared lowercased), while `show ip ROUTE`, `show ip interface BRIEF`, `show ip DHCP binding`, `show ipv6 ND` and `show mac ADDRESS-TABLE` were refused with `% Invalid show command: ...` - the sentence for a view the console does not have - about views it does have. ## Changed - `engine/cli.js`: `_show()` builds one lowercased copy of the line (`kw`) and the view branches compare through it (nat, interface+brief, route, dns, dhcp, ospf, bgp, ipv6 nd, mac address-table). Values are untouched. - `test/show-keyword-case.test.js`: 37 checks - eleven case variants equal their lower-case twins byte for byte, the real route/brief tables behind the capitalised spellings, refusals (`show ip FLURB`, `show i`) unmoved, and the letter of a typed value preserved in the refusal. - `research/show-keyword-case.md`: sources, before/after measurements, and what is still open (an interface *name* as opposed to the keyword; tail abbreviation; the caret sentence). - `docs/CLI.md`, `CHANGELOG.md`, and the tail-case bullet in `research/show-incomplete-view-word.md`, which had recorded `show mac Address-Table` as open. ## Gates - `node scripts/syntax-check.js` - 562 files, all OK. - Full suite: **478 suites, 16,052 assertions, 0 failed** (`--concurrency=8`, 288.8 s); `npm test`'s audits (port types, devices, control bytes) also clean. Ledger citations checker unchanged (same 4 tolerated drift suspects as on `main`).
cli(show): a keyword after show is matched in any case, as a box matches it
All checks were successful
CI / Test (Node 22) (pull_request) Successful in 1m1s
CI / Test (Node 24) (pull_request) Successful in 1m3s
CI / Server smoke and Docker build (pull_request) Successful in 1m5s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 11s
CI / Typecheck (pull_request) Successful in 19s
CI / Arm auto-merge (pull_request) Successful in 6s
22b3c5819e
`show ip ROUTE`, `show ip interface BRIEF`, `show ip DHCP binding`, `show ipv6 ND` and
`show mac ADDRESS-TABLE` were answered `% Invalid show command: ...` - the sentence for a view
this console does not have - while `show ip ARP` and `show POWER INLINE` worked, because the
first word of a `show` line was lowercased and the rest were compared against lower-case
literals. IOS states the rule: "You can enter commands in uppercase, lowercase, or mixed case.
Only passwords are case sensitive" and "Cisco IOS commands are generally case-insensitive".

`_show()` now builds one lowercased copy of the line (`kw`) and the view branches compare
through it: nat, interface+brief, route, dns, dhcp, ospf, bgp, ipv6 nd and mac address-table.
Values are untouched - a stray word is still quoted back in the case it was typed in.

test/show-keyword-case.test.js (37 checks); research/show-keyword-case.md; docs/CLI.md.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-24 02:52:30 +00:00
jaylouisw deleted branch rev/1124-0212 2026-11-24 03:08:29 +00:00
Sign in to join this conversation.
No description provided.