Skip to content

Commit

Permalink
Merge pull request #5866 from bnjmnt4n/mangen/hide-subcommands
Browse files Browse the repository at this point in the history
fix(mangen): do not generate man pages for hidden subcommands
  • Loading branch information
epage authored Jan 7, 2025
2 parents 92fcd83 + d96cc71 commit b94cb23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clap_mangen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub fn generate_to(
out_dir: impl AsRef<std::path::Path>,
) -> Result<(), std::io::Error> {
fn generate(cmd: clap::Command, out_dir: &std::path::Path) -> Result<(), std::io::Error> {
for cmd in cmd.get_subcommands().cloned() {
for cmd in cmd.get_subcommands().filter(|s| !s.is_hide_set()).cloned() {
generate(cmd, out_dir)?;
}
Man::new(cmd).generate_to(out_dir)?;
Expand Down

0 comments on commit b94cb23

Please sign in to comment.