Add helper to add commonly used cli arguments
- Dominant language
- C++
- Stars
- 14
- Forks
- 34
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 6
Description
Writing this because I just got annoyed by it, and I will otherwise forget to at least write it down.
We have quite a few arguments that are commonly added. We could consider adding a few of them already pre-configured to the `parser` we can import from `parseArgs`. The most commonly used one is probably `--compactFile`. I have done
```python
from k4FWCore.parseArgs import parser
parser.add_argument("--compactFile", type=str, description="...")
```
countless times. I am fairly certain there are more of them. The simplest solution would be to either add a function `parser_with_default_args` that sets up these arguments already before users add theirs (possibly even configurable for "sets of arguments").
Alternatively for `compactFile` specifically we might consider adding it to `k4run` and in case it is present also inject the `GeoSvc` properly configured with it into the `ExtSvc`s of our `ApplicationMgr` (as we already do with some other services, I think).
Contributor guide
Research direction
Start by reading the k4FWCore.parseArgs entry point and inspecting k4run, especially how existing services are configured. Clarify whether the goal is a reusable set of default arguments or specific compactFile handling; done means one agreed approach is implemented and its argument and service behavior is covered by the project’s existing checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100