Repository navigation
Commit df51685
committed
fix: pass a bare dash through byte for byte
Positional arguments reach the action unchanged, but the bare-dash
branch appended the trimmed copy, so " - " arrived as "-". Append
rargs[0] there as well, and compare against "-" directly rather than
checking the length.
Fold TestCommand_BareDashKeepsFollowingArgs into the table test, now
TestCommand_BareDash, and add cases for a dash with surrounding
whitespace and for an undefined flag after "-". Before this fix that
flag was silently dropped; it is now reported as an error.
Assisted-by: claude:claude-opus-5-5
Signed-off-by: Eng Zer Jun <[email protected]>1 parent 828fb80 commit df51685
2 files changed
Lines changed: 30 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
| 125 | + | |
| 126 | + | |
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
| 1159 | + | |
1180 | 1160 | | |
1181 | 1161 | | |
1182 | 1162 | | |
1183 | 1163 | | |
1184 | 1164 | | |
| 1165 | + | |
1185 | 1166 | | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1186 | 1172 | | |
1187 | 1173 | | |
1188 | 1174 | | |
1189 | 1175 | | |
1190 | 1176 | | |
1191 | 1177 | | |
1192 | 1178 | | |
1193 | | - | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1197 | 1192 | | |
1198 | 1193 | | |
1199 | 1194 | | |
| |||
1203 | 1198 | | |
1204 | 1199 | | |
1205 | 1200 | | |
| 1201 | + | |
| 1202 | + | |
1206 | 1203 | | |
1207 | 1204 | | |
1208 | 1205 | | |
| |||
1218 | 1215 | | |
1219 | 1216 | | |
1220 | 1217 | | |
1221 | | - | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1222 | 1224 | | |
1223 | 1225 | | |
1224 | 1226 | | |
| |||
0 commit comments