Commit 1b52757
committed
Add support for detecting args after double-dash
The crate provides support for detecting and ignoring double-dash ("--")
argument passed from command line, but it does not provide any
information about its presence or position to user.
For applications that may want to pass arguments after double-dash to
child process is such indication critical.
Add optional field `args_end` into Matches structure storing position of
first argument after double-dash (if there is any) and method to provide
user access to the data.
When checking for double-dash positin, it is important to make sure that
there actually are some arguments after it. Otherwise the position would
point to non-existent index in `free` list and would require additional
unnecessary checks on user side.1 parent a1bc6a8 commit 1b52757
2 files changed
+77
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
| 351 | + | |
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
| |||
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| 374 | + | |
372 | 375 | | |
373 | 376 | | |
374 | 377 | | |
| |||
471 | 474 | | |
472 | 475 | | |
473 | 476 | | |
474 | | - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
475 | 483 | | |
476 | 484 | | |
477 | 485 | | |
| |||
692 | 700 | | |
693 | 701 | | |
694 | 702 | | |
| 703 | + | |
695 | 704 | | |
696 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
697 | 709 | | |
698 | 710 | | |
699 | 711 | | |
| |||
1018 | 1030 | | |
1019 | 1031 | | |
1020 | 1032 | | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1021 | 1070 | | |
1022 | 1071 | | |
1023 | 1072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
211 | 222 | | |
212 | 223 | | |
213 | 224 | | |
214 | 225 | | |
215 | 226 | | |
| 227 | + | |
216 | 228 | | |
217 | 229 | | |
218 | 230 | | |
| |||
221 | 233 | | |
222 | 234 | | |
223 | 235 | | |
224 | | - | |
| 236 | + | |
225 | 237 | | |
226 | 238 | | |
227 | 239 | | |
228 | 240 | | |
229 | 241 | | |
| 242 | + | |
230 | 243 | | |
231 | 244 | | |
232 | 245 | | |
233 | 246 | | |
234 | 247 | | |
235 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
236 | 261 | | |
237 | 262 | | |
238 | 263 | | |
| |||
0 commit comments