Skip to content

Commit

Permalink
fix(mangen): do not generate man pages for hidden subcommands
Browse files Browse the repository at this point in the history
This aligns with the logic in `clap_mangen::render::subcommands`, where
hidden subcommands are not shown in the subcommand list.
  • Loading branch information
bnjmnt4n committed Jan 4, 2025
1 parent e5f1f48 commit d96cc71
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 d96cc71

Please sign in to comment.