Skip to content

All tools accept -h and --help - #885

Merged
mernst merged 25 commits into
codespecs:masterfrom
mernst:help-option-all-tools
Oct 12, 2026
Merged

mernst merged 25 commits into
codespecs:masterfrom
mernst:help-option-all-tools

Conversation

@mernst

@mernst mernst commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Tools that take no options other than -h/--help (SplitDtrace, ReadTrace, DtraceNonceFixer) now use DaikonGetopt, so they print usage for -h/--help and reject other options. Tools that use plume-lib Options (Chicory, DynComp, AnnotateNullable, BuildJDK) exit with status 0 after printing help.

New method DaikonGetopt.nonOptionArgs processes the arguments of such a tool. #887 adds the same method.

🤖 Generated with Claude Code

mernst and others added 2 commits October 6, 2026 17:06
Add DaikonGetopt, a Getopt subclass that throws a UserError describing an
unrecognized, ambiguous, or malformed option and handles -h and --help.
Use it in Daikon and in the other tools that use Getopt.

Remove Diff's -u and -z options, which had no effect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tools that take no options other than -h and --help now use DaikonGetopt, so
they print a usage message for -h and --help and reject other options.  Tools
that use plume-lib Options exit with status 0 after printing help.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: codespecs/daikon/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9d94e169-a336-4859-88d3-42aa0a578a76

📥 Commits

Reviewing files that changed from the base of the PR and between 73f50a3 and 5b001be.


📒 Files selected for processing (12)
  • doc/CHANGELOG.md
  • doc/daikon.texinfo
  • java/daikon/AnnotateNullable.java
  • java/daikon/Chicory.java
  • java/daikon/DaikonGetopt.java
  • java/daikon/DynComp.java
  • java/daikon/SplitDtrace.java
  • java/daikon/dcomp/BuildJDK.java
  • java/daikon/dcomp/BuildJDK24.java
  • java/daikon/test/BadOptionTest.java
  • java/daikon/tools/DtraceNonceFixer.java
  • java/daikon/tools/ReadTrace.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.



📝 Walkthrough

Walkthrough

Several command-line tools now print usage and exit successfully when help is requested. DaikonGetopt adds shared processing for non-option arguments, which SplitDtrace, DtraceNonceFixer, and ReadTrace use. SplitDtrace adds argument and input validation. ReadTrace and SplitDtrace expose mainHelper methods for programmatic calls.

Suggested reviewers: markro49


Priority: ➖ Normal

Change: Feature

Merge Risk | ⚪ Minimal · up to 5b001

Merge Risk: ⚪ Minimal · up to 5b001

The CLI changes are ready to merge after normal checks; no introduced behavior requiring a fix was identified.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 5b001

The changed entrypoints stop help requests before file processing or target execution. The shared parser does not add privileges, and comparison with the previous behavior found no material security risk introduced or worsened by this change.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The compared entrypoint changes retain the existing file-processing and target-launch authority. Newly public helpers expose the work previously reachable through public main methods; inspected callers do not establish a new privileged or remotely reachable execution path.

Trust Boundaries and Controls

  • observed — Help terminates before trace-file access, target launch, or JDK instrumentation. Non-help launcher requests retain their existing target checks, and both builders still require a destination before entering instrumentation paths.

Resilience and Maintainability Implications

  • observed — ReadTrace retains per-invocation ownership of its mutable file list, processor, program-point map, and sample storage. FileIO's global parsing state remains a pre-existing concurrency limitation; the helper extraction does not introduce it.

Pre-merge checks | Passed 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 93.75% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 10 files. (2 skipped: 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

mernst added 16 commits October 6, 2026 18:51
…menter argument errors on stderr, simplify ambiguity check
…option, report SplitterFactoryTest failures on stderr, shorten Diff error, align Annotate usage
… exiting, report instrumenter option errors in one line, make sentinels final
…enter -h to runtimechecker-options

DaikonGetopt again provides nonOptionArgs, argsAfterLeadingOptions, a
Supplier-based constructor, and setUsageHint, which codespecs#885-codespecs#888 use.
The instrumenter's -h and --help handling belongs to codespecs#888.
… arguments in SampleTester and SplitterFactoryTest, fix --user-defined-invariant spelling
@mernst

mernst commented Oct 11, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mernst

mernst commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mernst
mernst merged commit cf78e73 into codespecs:master Oct 12, 2026
59 checks passed
@mernst
mernst deleted the help-option-all-tools branch October 12, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant