cli: the help key is not a description or a pool name (#1691) #1693

Merged
jaylouisw merged 2 commits from fix/1116-1636 into main 2026-11-16 16:47:31 +00:00
Owner

Fixes #1691.

Two free-text positions still stored the help key as the text:

Catalyst2960(config-if)# description ?
Description set: ?          -> running-config: description ?  /  show interfaces: desc: ?

ISR4331(config)# ip nat pool ? 1.1.1.1 1.1.1.2 netmask 255.255.255.0
NAT pool "?" 1.1.1.1 - 1.1.1.2 netmask 255.255.255.0
                            -> show ip nat statistics: Address pools: 1 (? 1.1.1.1-1.1.1.2)

Both now refuse before anything is written, through the _helpKeyRefusal helper #1685 added, which
gained the noun so a description reads "not a description" instead of "not a name":

% "?" is the help key, not a description: `description <text>` - the description of Fa0/1 is unchanged
% "?" is the help key, not a name: `ip nat pool <name> <start> <end> netmask <mask>` - nothing was created

Only the whole value is the key: description edge?1 and a pool named pool?1 still work.

Tests: test/help-key-is-not-a-value.test.js gained sections 5 and 6 (17 assertions); 12 of them
failed before the fix, 40 pass after. node scripts/syntax-check.js — 354 files OK.
npm test — 283 suites, 10125 assertions, 0 failed.

Not in this PR: the no forms read the tokens they need and ignore the rest, so no hostname ?,
no vlan 42 name ? and no description ? clear/delete instead of asking. Filed separately; different
mechanism, different fix.

Fixes #1691. Two free-text positions still stored the help key as the text: ``` Catalyst2960(config-if)# description ? Description set: ? -> running-config: description ? / show interfaces: desc: ? ISR4331(config)# ip nat pool ? 1.1.1.1 1.1.1.2 netmask 255.255.255.0 NAT pool "?" 1.1.1.1 - 1.1.1.2 netmask 255.255.255.0 -> show ip nat statistics: Address pools: 1 (? 1.1.1.1-1.1.1.2) ``` Both now refuse before anything is written, through the `_helpKeyRefusal` helper #1685 added, which gained the noun so a description reads "not a description" instead of "not a name": ``` % "?" is the help key, not a description: `description <text>` - the description of Fa0/1 is unchanged % "?" is the help key, not a name: `ip nat pool <name> <start> <end> netmask <mask>` - nothing was created ``` Only the whole value is the key: `description edge?1` and a pool named `pool?1` still work. Tests: `test/help-key-is-not-a-value.test.js` gained sections 5 and 6 (17 assertions); 12 of them failed before the fix, 40 pass after. `node scripts/syntax-check.js` — 354 files OK. `npm test` — 283 suites, 10125 assertions, 0 failed. Not in this PR: the `no` forms read the tokens they need and ignore the rest, so `no hostname ?`, `no vlan 42 name ?` and `no description ?` clear/delete instead of asking. Filed separately; different mechanism, different fix.
cli: the help key is not a description or a pool name (#1691)
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 20s
CI / Server smoke test (pull_request) Successful in 18s
CI / Docker build (pull_request) Successful in 25s
CI / Test (Node 20) (pull_request) Successful in 55s
CI / Test (Node 18) (pull_request) Successful in 1m0s
CI / Test (Node 22) (pull_request) Successful in 59s
e1672ab54d
`?` is the key an operator presses to ask what goes here, and two free-text positions still
stored it as the text (#1691):

  description ?   set the port's description to "?" and answered "Description set: ?" - a
                  receipt shaped exactly like the one `description lab` gives, over whatever
                  description the port already had, and `show interfaces` then printed
                  "desc: ?";
  ip nat pool ?   made a NAT pool called "?" - `ip nat pool ? 1.1.1.1 1.1.1.2 netmask
                  255.255.255.0` was accepted, printed back by the running-config and listed
                  as "Address pools: 1 (? 1.1.1.1-1.1.1.2)", and a later `pool ?` would have
                  resolved through it.

Both are refused by name before anything is written, through the helper #1685 added
(`_helpKeyRefusal`), which now takes the noun so the description gets "not a description"
rather than "not a name". Only the whole value is the key: `description edge?1` and a pool
named `pool?1` are still accepted and stored as typed.

Reproduced first in test/help-key-is-not-a-value.test.js, which already pins the #1685 set:
12 of its assertions failed before the fix, 40 pass after it.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-16 16:47:23 +00:00
jaylouisw force-pushed fix/1116-1636 from e1672ab54d
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 20s
CI / Server smoke test (pull_request) Successful in 18s
CI / Docker build (pull_request) Successful in 25s
CI / Test (Node 20) (pull_request) Successful in 55s
CI / Test (Node 18) (pull_request) Successful in 1m0s
CI / Test (Node 22) (pull_request) Successful in 59s
to b54890f2bb
All checks were successful
CI / Classify the change (pull_request) Successful in 13s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 12s
CI / Test (Node 18) (pull_request) Has been skipped
CI / Test (Node 20) (pull_request) Has been skipped
CI / Test (Node 22) (pull_request) Has been skipped
CI / Server smoke test (pull_request) Has been skipped
CI / Docker build (pull_request) Has been skipped
2026-11-16 16:47:26 +00:00
Compare
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!1693
No description provided.