[llvm-test-suite] Refactor run script arg parsing to while/case (NFCI)#2248
Conversation
|
If you use |
|
I would avoid hand-parsing options at all costs :D |
I am aware of it and found sources saying it's better not to be used. I don't care which way we go. |
|
I wasn't aware of those concerns, sorry. But claude thinks:
|
|
While I have no clear preference, IMHO this current use-case is perfectly covered by Was just about to point out the concerns but Robert already did :) |
The reason I'm doing this is to enable us to include long-options, e.g., |
|
Sorry, that flew by me and I was only scanning the code -- it is actually hard to understand this intent TBH (at least for me). |
Replace the getopts builtin with GNU getopt as groundwork for adding long options. getopt normalizes the argument list (via eval set) so the parse loop handles long and short options uniformly. Preserves all existing short flags and bundled forms (e.g. -cbt, -j8, -j 8) with no behavior change.
6a22aba to
add4d6d
Compare
|
Switched the whole thing over to using |
|
nice, thanks! |
Replace getopts with a while/case parser as groundwork for adding long options. Preserves all existing short flags and bundled forms (e.g. -cbt, -j8, -j 8) with no behavior change.
This will be used in follow-up PRs which add support for enabling "heavier" libraris, e.g.,
--rocprimas additional targets.