Skip to content

clap.rs colored help menus for Julia launcher#1236

Open
MilesCranmer wants to merge 14 commits intoJuliaLang:mainfrom
MilesCranmer:julia-completions
Open

clap.rs colored help menus for Julia launcher#1236
MilesCranmer wants to merge 14 commits intoJuliaLang:mainfrom
MilesCranmer:julia-completions

Conversation

@MilesCranmer
Copy link
Copy Markdown
Member

@MilesCranmer MilesCranmer commented Aug 26, 2025

Currently the Julia help menu within juliaup is missing some of the juliaup-specific stuff, such as the [+channel] specifier. It also (1) lacks shell completions, (2) lacks colored output (makes it hard to read, especially with how long it has gotten), and (3) it cannot automatically wrap to terminal width.

This PR adds a full clap.rs help menu for the julia launcher. This gives us:

  1. Shell completion generation for Julia across multiple shells (--generate-completions <shell>)
  2. Colored hierarchy
  3. Automatic text wrapping

This also adds three flags:

  1. --help-raw to access the raw Julia help menu (such as for core developers).
  2. --help-hidden-raw equivalent but for --help-hidden.
  3. --generate-completions to generate completions for Julia using clap.rs.

(This is forked from #1234; that one needs to be merged first in any case).

Here is the current julia launcher help menu on 1.12:

image

And here is it on a narrow terminal:

image

With this PR, it looks like this:

image

and in a narrow terminal:

image

Comment thread src/julia_completions.rs
julia_cli_impl(true)
}

// NOTE: This was last generated against the Julia 1.12.0 help menu
Copy link
Copy Markdown
Member

@fingolfin fingolfin Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does that mean? Who or what "generated" it? And does this mean the list is specific to 1.12.0? So if 1.13 adds a new option, or removes one, it is not reflected?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just make it pass-through? Otherwise using --help via +nightly etc will be confusing, and i'm sure we'll forget to update this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I am worried we'd be showing stale --help data.

One way to deal with that would be to add a new hidden argument to Julia, something like --dump-commands which dumps JSON (?) describing all options, and whether they should be shown on --help or --help-hidden, etc. Then we could use that here. (And for the finite number of older versions, either this feature is disabled, or else we just hard code the JSON needed for them in juliaup

@fingolfin
Copy link
Copy Markdown
Member

This looks pretty nice but has merge conflicts by now :-(

@fingolfin
Copy link
Copy Markdown
Member

On concern with this PR is that it means that julia --help would look different depending on how Julia is installed. Now I am not saying this is a definite blocker, but it is a tradeoff to consider, and at least explicitly address and state "yes we know but we want it anyway" (count me in the "want it anyway" camp ;-) )

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.

3 participants