-
Notifications
You must be signed in to change notification settings - Fork 104
Colored + wrapped help menu #1234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Might be nice to have this on Julia itself too... |
IanButterworth
left a comment
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.
Nice
That seems like it would require either duplicating the clap.rs logic in Julia or something kind of complex and clunky. Maybe Julia could have a |
I think this could work. However, adding Another alternative could be a julia-MMtk type approach (JuliaLang/julia#56989) and make a new BinaryBuilder artifact for the help menu. The downside of this is that it would mean the help menu would live outside the source tree. Probably the cleanest longterm option is clap.rs integration directly in the Julia source tree. I just re-read your answer here -
If the rust code were confined to the entrypoint – just clap.rs providing the help menu, shell completions, option parsing, and then passing the validated arguments into Julia – I think this might be a reasonable direction to explore? |
|
On second thought I don't think |
|
Just replacing the CLI entry-point with Rust would be reasonable, but I think adding Rust to the Julia compilation toolchain may not be a popular move among core devs. |
|
But, could be worth a discussion. If the Rust entry-point has enough to recommend it, then could be worthwhile. |
|
I can definitely vouch for clap.rs being worth it. It’s very well maintained and optimized, with 22,000 direct dependent packages in rust alone. In my view, its existence is a major reason behind the proliferation of rust-based shell tools. Some key selling points:
In general, clap.rs is also super portable and constantly stress-tested across OSes and terminals. Maybe we trial it in juliaup, and if folks like it (and core devs are open), there could be a discussion about making it the standard entry point? |
|
@IanButterworth do you think this PR could be merged? This one doesn't add anything new, it's just to enable the text wrapping and color in the existing clap.rs menu for juliaup itself |
This adds standard colors to the help menus. It also enabled "wrap_text" on the binary so it can stay nicely formatted on narrow terminals.
Note that this default clap coloring automatically detects terminal compatibility before adding colors to the menu.
Before:
After: