GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@gnodet gnodet commented Jul 10, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions
@gnodet
feat: allow customizing the help source in Less pager (fixes #2056)
9f61b55
@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

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)
  • CLAUDE.md
✅ Files skipped from review due to trivial changes (1)
  • CLAUDE.md

📝 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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gnodet
gnodet marked this pull request as ready for review July 10, 2026 00:36
gnodet
gnodet commented Jul 10, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Member Author

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.

All reactions
@gnodet
docs: add merge rules to CLAUDE.md
73f4dff
@gnodet gnodet added the enhancement label Jul 11, 2026
@gnodet gnodet added this to the 4.3.2 milestone Jul 11, 2026
@gnodet
gnodet merged commit 54a5c9f into master Jul 11, 2026
14 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@sonarqubecloud

sonarqubecloud Bot commented Jul 11, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gnodet gnodet modified the milestones: 4.3.2, 4.4.0 Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement

Projects

None yet

Milestone

4.4.0

Development

Successfully merging this pull request may close these issues.

Support specifying custom Help information for Less builtin

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@gnodet
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.