-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add man page generation #11
base: main
Are you sure you want to change the base?
Conversation
As |
@@ -275,6 +286,8 @@ impl ValueEnum for Shell { | |||
Self::Elvish => clap::builder::PossibleValue::new("elvish"), | |||
Self::Fig => clap::builder::PossibleValue::new("fig"), | |||
Self::Fish => clap::builder::PossibleValue::new("fish"), | |||
#[cfg(feature = "man-page")] | |||
Self::ManPage => clap::builder::PossibleValue::new("man"), |
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'm torn on what this should be, for example:
Self::ManPage => clap::builder::PossibleValue::new("man"), | |
Self::ManPage => clap::builder::PossibleValue::new("man-page"), |
if cfg!(feature = "man-page") { | ||
assert_eq!( | ||
names, | ||
vec!["bash", "elvish", "fig", "fish", "man", "powershell", "zsh"], | ||
); | ||
} else { | ||
assert_eq!( | ||
names, | ||
vec!["bash", "elvish", "fig", "fish", "powershell", "zsh"], | ||
); | ||
} |
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.
We should make this scale better for when we add more features in the future.
For people who want to customise their man pages more, like providing a date, we should also make it easy for lib users to special case when the user chooses man page generation, where they can access a more specific API, which would also make it easy to generate separate man pages for each subcommand (clap-rs/clap#3365 (comment), clap-rs/clap#3603). This could also be used as a way to provide man page generation before |
Closes #10