Skip to content

Commit 4f3978a

Browse files
committed
fix(man): exclude hidden args from conflict map
Skip hidden args (e.g. --deduplicate-hardlinks on non-Unix) when building the conflict map so the man page doesn't reference options that are not listed on the current platform. https://claude.ai/code/session_01CrXuWDMVQsiUBoy6ceACsF
1 parent d52a240 commit 4f3978a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/man_page.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,20 @@ pub fn render_man_page() -> String {
2323
}
2424

2525
/// Builds a bidirectional conflict map from clap's one-directional conflict declarations.
26+
///
27+
/// Hidden args are excluded so the man page doesn't reference options
28+
/// that are not listed on the current platform.
2629
fn build_conflict_map(command: &Command) -> ConflictMap {
2730
let mut map = ConflictMap::new();
2831
for arg in command.get_arguments() {
32+
if arg.is_hide_set() {
33+
continue;
34+
}
2935
let arg_id = arg.get_id().to_string();
3036
for conflict in command.get_arg_conflicts_with(arg) {
37+
if conflict.is_hide_set() {
38+
continue;
39+
}
3140
let conflict_id = conflict.get_id().to_string();
3241
map.entry(arg_id.clone())
3342
.or_default()

0 commit comments

Comments
 (0)