[core] Use optparse in TApplication's option parsing#22689
Conversation
1. ability to ignore unknown flags and query all unprocessed arguments. This is useful for stuff like TApplication that needs to "pass through" unknown flags; 2. ability to query which arguments came after `--`. This is almost never needed, but it is used as a feature by, again, TApplication.
This allows accepting args coming from a `char **` and without const-casting it to `const char **`.
vepadulano
left a comment
There was a problem hiding this comment.
Thank you for this effort! I left a couple of minor comments.
| -t, --enable-threading Enable thread-safety and implicit multi-threading (IMT) | ||
| -q, --quit-after-processing Exit after processing command line macro files | ||
| -l, --no-banner Do not show the ROOT banner | ||
| -config print ./configure options |
There was a problem hiding this comment.
Not for this PR, but just wanted to note that I didn't even know this existed, I tried it and I still don't understand what is the intended use case for it.
There was a problem hiding this comment.
Not really clean given we also have root-config as a separate CLI
There was a problem hiding this comment.
I would be in favor of removing it (alongside -splash and maybe the argument-less --web), but we need to decide whether we want to break compatibility. Perhaps for root 7? @dpiparo
There was a problem hiding this comment.
I think it's early to do this for 6.42, and discussing that would cause a momentum loss. Can we maybe go ahead with this PR and then discuss the removal of the 2 options above separately?
There was a problem hiding this comment.
I agree. For now should we mark them as deprecated but keep accepting them?
Test Results 23 files 23 suites 3d 16h 11m 42s ⏱️ For more details on these failures, see this check. Results for commit 5c9edbf. ♻️ This comment has been updated with latest results. |
This Pull request:
replaces
TApplication::GetOptions's implementation with one using the newoptparse.hxxfunctionality. All existing flags are preserved for backward compatibility, but:-ais not working as intended, so it's now ignored-splashseemed unused, so it's ignored as wellDue to this change, we don't need anymore to generate the command line header file via
root-argparse.py. In a future PR I intend to do the same changes torootxandhaddand eventually get rid of the wholeargparse2help.pyfunctionality.