-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Show command help in $PAGER or less #3434
Comments
Hey, i would like to take a look at this, as a first contribution. I am not entirely sure, I understand the details fully though. Edit: Found HELP_DETAIL or rather the place where |
In general it looks like only |
@phillyphil91 thank you for spending time on this. |
The clap community has a friendly discussions page here https://github.com/clap-rs/clap/discussions so asking there for some guidance might be helpful as well. |
Good idea. I will have a look there.
Clap allows you to write to stdout or to a io::Write object. |
I was thinking if we can capture the help output, then maybe we can execute |
i was thinking the same, but was not able to get anything meaningful working yet. I'll have another look at spawning (sub)processes. Thanks |
I found something that allows you to open a sub-process for example for But I opened a question in the clap forum to see if they have any idea: clap-rs/clap#4200 |
So according to clap-rs/clap#4201, using a pager for the help output is currently being investigated by the |
@phillyphil91 Thank you for exploring this and engaging with the Clap community on that thread. I'll leave the issue open so we remember to come back to it. In the meantime, maybe we should invest effort in making |
In clap v4 (working on wrapping up the final documentation for it), we've updated the help output in hopes to reduce confusion on this. See clap-rs/clap#4159 |
@epage Thank you for that context. clap v4 sounds exciting, looking forward to upgrading to it! |
So create different help messages according to if And the |
@phillyphil91 that's exactly what I was thinking. We maybe able to control it with a help_template or long_help related options in clap. |
If you want, with If you aren't defining your own help, it can most likely work by doing something like |
Hello, maybe it can help, the great https://github.com/sharkdp/bat tool automatically (I guess it is configurable) uses pager if output is too long. |
@cailloumajor 👋 If you have thoughts / ideas on how this could work until clap has it baked in. We'd love to learn more / explore them with you. |
Some pre-built pager options
If you go the route of writing your own pager, I've compared different pager implementations for my experiment with a git tool and to prepare for integrating a pager into clap. |
but or would that be achievable via |
If you want the clap v4 behavior where the description for ripgrep and bat take a different approach where they put it in either the command's |
I think what you are wanting to set is |
The above PR implements the approach of using Personally I'm not a fan of using pagers as default in help, as it typically requires to quit that pager. Most of the time when help is displayed options are either missing, typos or order issues occurred, therefore the short help should be fine for the larger portion of the cases. |
To address the issue of the early line wraps I've opened a ticket & PR on clap. |
The clap PR was accepted and the version has been updated. This was included in #3622 |
Hi there! I am working with some new contributors to open source to get them setup on this repo and looking for a good first issue. Given the update in #3622 - is this issue still open as written? |
@mariannegoldin yes, we've made progress in breaking out ockam/implementations/rust/ockam/ockam_command/src/node/create.rs Lines 54 to 55 in 3227d2a
|
Thanks much! This will be good context to look at in determining if we are able to take this issue on. |
This is the issue that my team has chosen for our first attempt. We are students and this is our first open-source project. If there is any additional information you can provide for us, we would greatly appreciate it. |
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses build-trust#3434
using $PAGER if set, defaulting to `less` and falling back to `more` or no pagination if no pager is available. Addresses #3434
Currently:
We have many help commands that show a long help, for example
ockam secure-channel --help
. This hides the command syntax above the fold.Desired:
less
We love helping new contributors!
If you have questions or need help as you work on your first Ockam contribution, please leave a comment on this discussion.
If you're looking for other issues to contribute to, checkout this discussion and labels - good first issue or help wanted
The text was updated successfully, but these errors were encountered: