cli: show ip bgp refuses a word it cannot use, instead of dropping it #2263

Merged
jaylouisw merged 1 commit from rev/1120-0512 into main 2026-11-20 05:21:12 +00:00
Owner

_showBgp(args) was handed the tail and read it nowhere, so show ip bgp 10.0.0.0/24, show ip bgp regexp ^65002, show ip bgp neighbors and a plain typo all printed the whole table — the non-answer show ip route <prefix> gave before #1403 (a table with prefixes in it reads as "yes, that one is in there").

Evidence. A box refuses the word: sh ip bgp neighbors br draws % Invalid input detected at '^' marker. on an IOS XE switch (https://community.cisco.com/t5/routing/bgp-using-layer-3-switches/td-p/5075192). Neither spelling has a free positional word — show ip bgp's keyword list ends at route-map <name>, show ip bgp summary's at [slow] (Cisco IOS IP Routing: BGP Command Reference, irg_bgp5.html).

Change. summary is the only word the door accepts. Anything else is refused in the showNoTail() shape and names the Network column as where one prefix is read; show ip bgp does take an ip-address as a filter on a box, so the sentence is this console's claim about itself (the trade show ip route <prefix> already makes). neighbors/neighbour(s) answer has no detail view here — a box has that view and this console has no detail block, so "does not take" would be the wrong sentence (the form show ip nat translations verbose takes). The % BGP not active guard still runs first, so a process-less box still answers every spelling with the five words.

Plan. docs/plans/bgp-show-views.md step 2, refusal half (the dispatch to real per-view functions is steps 3-6 and stays open).

Research. research/show-ip-bgp-argument-refusal.md — what is known, the one inferred ordering, and the open question (does IOS parse a junk word before it consults BGP state?).

Tests. test/show-ip-bgp-argument-refusal.test.js (63 assertions): the table has content; five tails refused one line each with the words quoted and no table; summary <word> refused and summary still answers; neighbors answered as a gap not a stray word; the process-less path unchanged for five spellings. Full suite: 401 suites, 13,351 assertions, 0 failed. node scripts/syntax-check.js: 481 files OK.

`_showBgp(args)` was handed the tail and read it nowhere, so `show ip bgp 10.0.0.0/24`, `show ip bgp regexp ^65002`, `show ip bgp neighbors` and a plain typo all printed the whole table — the non-answer `show ip route <prefix>` gave before #1403 (a table with prefixes in it reads as "yes, that one is in there"). **Evidence.** A box refuses the word: `sh ip bgp neighbors br` draws `% Invalid input detected at '^' marker.` on an IOS XE switch (https://community.cisco.com/t5/routing/bgp-using-layer-3-switches/td-p/5075192). Neither spelling has a free positional word — `show ip bgp`'s keyword list ends at `route-map <name>`, `show ip bgp summary`'s at `[slow]` (Cisco IOS IP Routing: BGP Command Reference, irg_bgp5.html). **Change.** `summary` is the only word the door accepts. Anything else is refused in the `showNoTail()` shape and names the Network column as where one prefix is read; `show ip bgp` *does* take an ip-address as a filter on a box, so the sentence is this console's claim about itself (the trade `show ip route <prefix>` already makes). `neighbors`/`neighbour(s)` answer `has no detail view here` — a box has that view and this console has no detail block, so "does not take" would be the wrong sentence (the form `show ip nat translations verbose` takes). The `% BGP not active` guard still runs first, so a process-less box still answers every spelling with the five words. **Plan.** `docs/plans/bgp-show-views.md` step 2, refusal half (the dispatch to real per-view functions is steps 3-6 and stays open). **Research.** `research/show-ip-bgp-argument-refusal.md` — what is known, the one inferred ordering, and the open question (does IOS parse a junk word before it consults BGP state?). **Tests.** `test/show-ip-bgp-argument-refusal.test.js` (63 assertions): the table has content; five tails refused one line each with the words quoted and no table; `summary <word>` refused and `summary` still answers; `neighbors` answered as a gap not a stray word; the process-less path unchanged for five spellings. Full suite: 401 suites, 13,351 assertions, 0 failed. `node scripts/syntax-check.js`: 481 files OK.
cli: show ip bgp refuses a word it cannot use, instead of dropping it
All checks were successful
CI / Classify the change (pull_request) Successful in 25s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 18s
CI / Test (Node 22) (pull_request) Successful in 1m19s
CI / Test (Node 20) (pull_request) Successful in 1m20s
CI / Server smoke and Docker build (pull_request) Successful in 30s
CI / Test (Node 18) (pull_request) Successful in 1m25s
CI / Arm auto-merge (pull_request) Successful in 4s
cd0fea77b9
`_showBgp(args)` was handed the tail and read it nowhere, so `show ip bgp
10.0.0.0/24`, `show ip bgp regexp ^65002`, `show ip bgp neighbors` and a plain
typo all printed the whole table - the same non-answer `show ip route <prefix>`
gave before #1403: a table with prefixes in it reads as "yes, that one is in
there".

A box refuses the word. `sh ip bgp neighbors br` on an IOS XE switch draws
`% Invalid input detected at '^' marker.`
(https://community.cisco.com/t5/routing/bgp-using-layer-3-switches/td-p/5075192),
and neither spelling has a free positional word - `show ip bgp`'s keyword list
ends at `route-map <name>`, `show ip bgp summary`'s at `[slow]`
(https://cisco.com/c/en/us/td/docs/ios/iproute_bgp/command/reference/irg_book/irg_bgp5.html).

`summary` is now the only word the door accepts. Any other is refused in the
`showNoTail()` shape, naming the Network column as where one prefix is read -
`show ip bgp` does take an ip-address as a filter on a box, so the sentence is
this console's claim about itself, the trade `show ip route <prefix>` already
makes. `neighbors`/`neighbour(s)` are answered as `has no detail view here`
(a box has that view, this console has no detail block - the form
`show ip nat translations verbose` takes). The `% BGP not active` guard still
runs first, so a process-less box answers every spelling with the five words,
as captured and as `test/bgp-not-active.test.js` pins.

plan: docs/plans/bgp-show-views.md step 2, refusal half.
research: research/show-ip-bgp-argument-refusal.md (one ordering question open).

Tests: 401 suites, 13351 assertions, 0 failed; new suite 63 assertions.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-20 05:20:24 +00:00
jaylouisw deleted branch rev/1120-0512 2026-11-20 05:21:14 +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!2263
No description provided.