GeezerVison is showing github.com — Parse the correlator's command line with picocli by lhotari · Pull Request #8 · jonoffcpu/jonoffcpu
Conversation
lhotari
commented
Sep 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
First of the 0.5.0 correlator stack (spec: cli-picocli.md). Moves every correlator command to picocli, so the later PRs can add the transform, top, summarize and export options as typed picocli options.
Stack: #8 (this) ← #10 stack transforms ← #11 SQL-friendly export ← #12 top/summarize ← #13 README. Independent: #9 (population estimate); its --max-accounted-loss needs porting to picocli when both land — a verified resolution is on branch population-estimate-on-picocli.
What changes
- Top-level command still correlates with the same options;
correlate names it explicitly. stacks, merge, export, dump are subcommands; --dump --source FILE stays as a deprecated alias.
help <command> / <command> --help show each command's options and defaults; --version prints the build and the pinned async-profiler fork commit.
- Option names, values, defaults and meanings are unchanged.
- Behaviour change: an invalid command line now returns 64 (EX_USAGE) with the message, a "did you mean" hint and the command's usage on stderr, instead of throwing
IllegalArgumentException out of run(). picocli's default of 2 would collide with "narrowed/partial". run() still never calls System.exit, and analysis failures still throw.
- picocli 4.7.7 is embedded with a pinned SHA-256 and relocated under
io.github.lhotari.jonoffcpu.correlator.internal.shaded.picocli.
- Required options are checked by the command rather than picocli's
required, because picocli reports a missing required option ahead of an unknown one, which would hide a typo such as stacks --stakc.
Verification
./gradlew spotlessCheck :jonoffcpu-correlator:check passes.
- New
CommandLineTest: help snapshots per command (src/test/resources/help/*.txt), usage errors (64, usage shown, no stack trace), dump and --dump give identical output, run returns control on a failing correlation, and the README's option names and stated defaults are checked against the parser.
- On the Pulsar broker fixture profile,
stacks (default, launcher-style --package-names drop --summary --exclude-from, --stack java+kernel --reason blocked) and export (csv, jsonl) write files byte-identical to the published pre-picocli 0.5.0-SNAPSHOT JAR.
- The shaded JAR contains no unrelocated
picocli/ classes, and java -jar works on its own.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The correlator's options were parsed by hand: one stale usage string for every
command, the same "Unknown, duplicate or missing option" error thrown as a
stack trace for any mistake, and a special case for each repeatable option.
It is about to grow by some thirty options and two subcommands, so every
command is now a picocli command.
- The top-level command still correlates with the same options, and
`correlate` names it explicitly. `stacks`, `merge`, `export` and `dump`
are subcommands; `--dump --source FILE` is kept as a deprecated alias of
`dump --source FILE`. `help <command>` and `<command> --help` print the
command's options with their defaults, and `--version` the build and the
pinned async-profiler fork commit.
- Option names, values, defaults and meanings are unchanged. Enumerated
values are converted by type and an invalid one lists the valid values;
comma-separated and repeatable options keep their forms and order.
- Behaviour change: an invalid command line returns 64 (EX_USAGE) with the
message, a "did you mean" suggestion for a mistyped option and the
command's usage on stderr, instead of throwing IllegalArgumentException
out of run(). picocli's default of 2 would collide with "narrowed or
partial". run() still returns the exit code and never calls System.exit,
and a failure of the analysis itself still throws.
- picocli 4.7.7 is embedded with a pinned digest and relocated under the
correlator's internal package, like the other bundled dependencies.
CommandLineTest checks each command's help against a snapshot in
src/test/resources/help, usage errors (exit 64, usage shown, no stack
trace), that dump and --dump agree, and that every option the README's
correlate, slicing and "Correlator options" sections name exists in the
parser with the default the table states. On the Pulsar broker fixture
profile, stacks and export write byte-identical files to the published
pre-picocli 0.5.0-SNAPSHOT.
This was referenced Sep 23, 2026
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|