a ? at the end of a no line is not a question: no vlan 42 name ? deletes VLAN 42 and no hostname ? clears the name #1694
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge#1694
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The measurement
Found while sweeping the free-text positions for #1691. The
noforms read the tokens they need andignore everything after them, so a
?typed where the operator expects help does not ask: it acts.no vlan 42 name ?is the worst of the three: the operator asked whatnamewants afterno vlan 42, and the VLAN is gone — with a receipt that reads like success, exactly the shape #1497removed from the set forms and #1685 removed from the free-text ones.
Why this is not #1691
#1691 is a value that is stored: the key became a name, and refusing it at the point where the name
is written fixes it. Here the key is the last of several tokens, and the damage is done by the tokens
before it —
no vlan 42is a complete, destructive line on its own. The check has to run before thenobranch acts, and it has to know the syntax of the branch it is guarding, so the refusal can namewhat was wanted instead of just complaining.
The shape of the fix
In config and interface mode, if the last token of a
noline is exactly?, refuse and changenothing:
The noun and the syntax come from the branch, so the answer is useful. A
?inside a longer word(
no vlan 42 name lab?1) is still part of the value. Worth pinning per branch:no hostname,no vlan,no description, and the same sweep over the othernoheads (no ip route,no ip nat pool,no spanning-tree) to see which of them also ignore trailing tokens.?at the end of anoline removes nothing and names the syntax #1699