GeezerVison is showing github.com — feat: allow customizing the help source in Less pager (fixes #2056) by gnodet · Pull Request #2065 · jline/jline3
Conversation
gnodet
commented
Jul 10, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- Adds a
helpSource(Source) fluent setter to Less that lets applications embedding the Less pager provide custom help text displayed when the user presses h/H
- When not set, the built-in
less-help.txt resource is used as before (fully backward-compatible)
- Accepts any
Source implementation (ResourceSource, PathSource, URLSource, InputStreamSource, etc.), giving maximum flexibility
Fixes #2056
Motivation
When Less is embedded in an application, the default help text references command-line options and the term "LESS" which are not applicable. The existing workarounds (classpath manipulation or JAR repackaging) are fragile and version-dependent. This change provides a clean, supported API to customize the help content.
Usage
Less less = new Less(terminal, currentDir)
.helpSource(new Source.ResourceSource("my-app-help.txt", "APP HELP"));
Or with inline content:
byte[] helpBytes = "My custom help text...".getBytes(StandardCharsets.UTF_8);
Source help = new Source.InputStreamSource(
new ByteArrayInputStream(helpBytes), true, "HELP");
Less less = new Less(terminal, currentDir).helpSource(help);
Test plan
-
helpSourceSetterUpdatesFieldAndReturnsSameInstance — verifies setter stores the source and returns this
-
helpSourceDefaultIsNull — verifies default is null (backward-compatible)
-
helpSourceWithConstructorOptionsDefaultsToNull — verifies constructor doesn't interfere
-
helpSourceSetterAllowsChaining — verifies fluent chaining with defaultPrompt()
- All 17 existing+new LessTest tests pass
- Full project build succeeds
Summary by CodeRabbit
-
New Features
- Added support for providing custom help content in the pager.
- Custom help can be set via a fluent
helpSource(...) configuration; it’s used when provided.
- If no custom help is set, the built-in help page is shown.
-
Tests
- Added tests for default behavior, setting custom help content, and fluent chaining (including interaction with other pager settings).
-
Documentation
- Updated PR merging guidance to require squash-merge conventions and milestone/label steps.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Jul 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9875e604-a6d3-471e-aeba-b387639f59ee
📥 Commits
Reviewing files that changed from the base of the PR and between 9f61b55 and 73f4dff.
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 Walkthrough
Walkthrough
Less now supports a configurable help Source, using it in the pager when provided and retaining less-help.txt as the fallback. Tests cover default state, setter behavior, and fluent chaining. CLAUDE.md adds pull request merge requirements.
Changes
Less help source
| Layer / File(s) |
Summary |
Custom help source contract builtins/src/main/java/org/jline/builtins/Less.java, builtins/src/test/java/org/jline/builtins/LessTest.java |
Less stores an optional help Source, exposes a fluent setter, and tests default state, assignment, and chaining behavior. |
Help source selection builtins/src/main/java/org/jline/builtins/Less.java |
run(List<Source>) prepends the configured help source or falls back to less-help.txt. |
Merge process documentation
| Layer / File(s) |
Summary |
Merging PRs rules CLAUDE.md |
Adds requirements for squash merges, commit message format, labels, and release milestones. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Suggested labels: documentation
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name |
Status |
Explanation |
Resolution |
| Out of Scope Changes check |
⚠️ Warning |
CLAUDE.md changes about merge policy are unrelated to the Less help-source feature and appear out of scope. |
Remove the CLAUDE.md merge-policy edits unless they are part of a separate documentation-only PR. |
✅ Passed checks (4 passed)
| Check name |
Status |
Explanation |
| Description Check |
✅ Passed |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
✅ Passed |
The title clearly describes the main change: customizable help source support in Less, with the issue referenced. |
| Linked Issues check |
✅ Passed |
The code adds a custom help Source with a built-in fallback, matching the embedded-help customization requested in #2056. |
| Docstring Coverage |
✅ Passed |
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
implement-20546
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM — Clean, well-scoped feature addition that adds a helpSource(Source) fluent setter to Less, allowing embedders to customize the help text shown when the user presses h/H. The implementation is correct, backward-compatible, and follows the existing pattern established by defaultPrompt().
The commit message follows project conventions (feat: with fixes #2056), the Javadoc is clear, and when helpSource is not set the existing ResourceSource("less-help.txt") behavior is preserved.
Note: CI failures are unrelated — caused by GitHub API rate limiting preventing the mvx build wrapper download.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of Guillaume Nodet
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
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
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.
|