Support extended functionalities in CLI
- Dominant language
- Java
- Stars
- 6.1k
- Forks
- 1.5k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 189
Description
#7673 outlines the major step to retire args4j and replace it with picocli.
However there are a couple of follow-ups that we need to do to ensure better error messaging and raising earlier argument parsing exception
1. Add mutually exclusive option check for now. (e.g. -configFile cannot be used together with explicit config settings, but we dont error out for now)
2. Add enum checker (e.g. -fileFormat accepts only ARVO/JSON/CSV... but not arbitrary string)
3. Usage of `org.apache.pinot.tools.Command` and `org.apache.pinot.tools.AbstractBaseCommand` can be simplify because picocli natively supports --help and --version redirect. We might be able to get rid of `org.apache.pinot.tools.Command` interface entirely.
4. Usage of the `picocli.CommandLine.pargeArgs` is used because of a backward-compatibility migration step from args4j, but technically picocli doesn't really need the additional parseArgs step (similar to the --help and --version, it is baked in `CommandLine.execute(args)` and we should use that instead.
Also several enhancement:
1. better printout for help messages and example. currently it doesn't format as cleanly as other arg parsers.
2. better testing for CLI, there's not enough test / IT cases for these CLI entrypoints (#7643 as one example to try improving but haven't been working reliably)
Contributor guide
Research direction
Start with the migration described in #7673 and inspect org.apache.pinot.tools.Command, org.apache.pinot.tools.AbstractBaseCommand, and the CLI entry points using picocli.CommandLine.parseArgs. Review #7643 for existing CLI test and integration-test coverage. Done means the requested argument validation, help formatting, parsing behavior, and tests are addressed, but the issue does not identify a narrower starting file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100