Skip to content
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

Use paging for uv help display when available #4909

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jul 8, 2024

Extends #4906

Adds paged display of "long' help to uv help invocations when less or more is available.

@zanieb zanieb added the cli Related to the command line interface label Jul 8, 2024
@zanieb zanieb force-pushed the zb/cli-help-cmd branch from aeb3de7 to bd5670c Compare July 8, 2024 21:12
@zanieb zanieb force-pushed the zb/cli-help-pager branch from 7265779 to ef9672b Compare July 8, 2024 21:15
@zanieb zanieb force-pushed the zb/cli-help-cmd branch from bd5670c to 0344631 Compare July 8, 2024 21:17
@zanieb zanieb force-pushed the zb/cli-help-pager branch 6 times, most recently from 1d97fa8 to 1bbf87c Compare July 8, 2024 22:42
@zanieb zanieb marked this pull request as ready for review July 9, 2024 00:28
@zanieb zanieb force-pushed the zb/cli-help-cmd branch from 0344631 to 66f4c15 Compare July 9, 2024 14:15
@zanieb zanieb force-pushed the zb/cli-help-pager branch 3 times, most recently from 95f4105 to 95e55b9 Compare July 9, 2024 14:35
@zanieb zanieb force-pushed the zb/cli-help-cmd branch from 66f4c15 to 9ab8af6 Compare July 9, 2024 16:32
@zanieb zanieb force-pushed the zb/cli-help-pager branch from 95e55b9 to ecf9b3b Compare July 9, 2024 16:33
zanieb added a commit that referenced this pull request Jul 9, 2024
I feel like I'm always drowning in the help output from `uv` because we
have so many options.

I basically agree with the commentary in
clap-rs/clap#4687 that having different
behaviors for `-h` and `--help` is surprising. I think `--help` is more
obvious for users and I want to optimize for that experience.

This roughly matches the help menus in Cargo and pip.

The `uv help` command can be used for long help. In #4906 and #4909 we
improve that command.

Extends #4904 which adds test cases for the existing behavior.
@zanieb zanieb force-pushed the zb/cli-help-pager branch from ecf9b3b to 8d05d3d Compare July 9, 2024 17:13
@zanieb zanieb force-pushed the zb/cli-help-cmd branch 2 times, most recently from b12be73 to d994157 Compare July 9, 2024 17:31
@zanieb zanieb force-pushed the zb/cli-help-cmd branch 2 times, most recently from ca1caee to 5736207 Compare July 9, 2024 17:34
Base automatically changed from zb/cli-help-cmd to main July 9, 2024 17:43
zanieb added a commit that referenced this pull request Jul 9, 2024
Extends #4772 

Implements `uv help` ourselves so we can do things like #4909 
Adds hints to use `uv help` for more details during short help display.
@bluetech
Copy link

bluetech commented Jul 9, 2024

It is customary to consult the PAGER environment variable instead of invoking less or more directly. systemd has elaborate logic for this, though probably too complicated for uv (maybe there's a crate for this...): https://github.com/systemd/systemd/blob/1df981a74ae19513b40167c6b320c30bd166ac34/src/shared/pager.c

@zanieb zanieb force-pushed the zb/cli-help-pager branch from 8d05d3d to 2e81b6a Compare July 9, 2024 17:55
@zanieb
Copy link
Member Author

zanieb commented Jul 9, 2024

@bluetech thanks for pointing that out! I probably won't address here just to keep things simple (and we're doing what Cargo does which is a reasonable starting point). I'd welcome a pull request to add support for PAGER though!

@zanieb zanieb force-pushed the zb/cli-help-pager branch from 2e81b6a to dc4cea1 Compare July 9, 2024 17:58
@zanieb zanieb enabled auto-merge (squash) July 9, 2024 17:59
@zanieb zanieb merged commit bd7a25f into main Jul 9, 2024
49 checks passed
@zanieb zanieb deleted the zb/cli-help-pager branch July 9, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants