-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat: add man pages and shell completions #683
base: master
Are you sure you want to change the base?
feat: add man pages and shell completions #683
Conversation
3813a38
to
a6b1254
Compare
Upstream issue: clap-rs/clap#5337 Could add shell completions now and think about man pages later. Long-term could auto-complete bar names and other information as well. |
Auto-generated with clap.
a6b1254
to
e329f3f
Compare
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.
Thanks for your work here, this will be a great QoL improvement to have. Looking like it's most of the way there already.
I'll be looking to merge this as part of the 0.17.0 release as 0.16.1 will be bugfixes only.
let man_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("target/man"); | ||
let mut buffer = Vec::default(); | ||
|
||
Man::new(cmd.clone()).render(&mut buffer).unwrap(); |
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.
I appreciate this is just a build script, but I'd still prefer to keep unwrap
s out of the code pls. I'll be more lenient than usual towards using expect
everywhere so long as it's clear why it shouldn't crash.
src/cli.rs
Outdated
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.
What's the reason for the restructuring here and moving handle_response
? It looks like the diff has gone funny, so I'm assuming this isn't entirely intentional?
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.
I think this was to avoid unused code warnings from build.rs
Unfortunately I doubt I'll have time to work on this anytime soon but you're free to change anything as needed. Should also avoid duplicate code from |
No worries, thanks for the heads up. I'm happy to take it from here, appreciate the work you've done to get it this far. |
Auto-generated with clap.
Note: May be ideal to replace some of the sub-commands with flags to decrease the amount of generated man pages.
Edit: Draft while I think of something better to do here