Commit adff99b
committed
fix: keep -h reserved for help flag
The previous change avoided a panic by falling back to a long-only help flag
when shorthand "h" was already in use. Reviewer feedback noted this would be
a behavior change: -h is intentionally reserved for help, and the panic acts
as an early signal of a developer conflict.
Restore the panic on shorthand conflicts, but make it explicit and clearer by
detecting an existing -h flag and panicking with a targeted message. Update
the test to assert the reserved-shorthand behavior.
Refs: spf13#2367
Context: reviewer feedback on PR1 parent bb3fbc8 commit adff99b
2 files changed
Lines changed: 6 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1226 | 1226 | | |
1227 | 1227 | | |
1228 | 1228 | | |
1229 | | - | |
1230 | | - | |
1231 | | - | |
1232 | | - | |
| 1229 | + | |
| 1230 | + | |
1233 | 1231 | | |
| 1232 | + | |
1234 | 1233 | | |
1235 | 1234 | | |
1236 | 1235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
939 | 939 | | |
940 | 940 | | |
941 | 941 | | |
942 | | - | |
| 942 | + | |
943 | 943 | | |
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
948 | 948 | | |
949 | | - | |
950 | | - | |
| 949 | + | |
| 950 | + | |
951 | 951 | | |
952 | 952 | | |
953 | 953 | | |
954 | 954 | | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | | - | |
959 | 955 | | |
960 | 956 | | |
961 | 957 | | |
| |||
0 commit comments