Skip to content

Commit a7c9d03

Browse files
authored
Merge pull request #9152 from shayelkin/main
uudoc: fix manpage for individual utilities has wrong name (nit)
1 parent 39a8c87 commit a7c9d03

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/bin/uudoc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ fn gen_manpage<T: Args>(
6666
args: impl Iterator<Item = OsString>,
6767
util_map: &UtilityMap<T>,
6868
) -> ! {
69+
uucore::set_utility_is_second_arg();
6970
let all_utilities = validation::get_all_utilities(util_map);
7071

7172
let matches = Command::new("manpage")

tests/uudoc/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ fn test_manpage_generation() {
3434
);
3535

3636
let output_str = String::from_utf8_lossy(&output.stdout);
37-
assert!(output_str.contains("\n.TH"), "{output_str}");
37+
assert!(output_str.contains("\n.TH ls"), "{output_str}");
3838
assert!(output_str.contains('1'), "{output_str}");
39+
assert!(output_str.contains("\n.SH NAME\nls"), "{output_str}");
3940
}
4041

4142
#[test]
@@ -57,8 +58,9 @@ fn test_manpage_coreutils() {
5758
);
5859

5960
let output_str = String::from_utf8_lossy(&output.stdout);
60-
assert!(output_str.contains("\n.TH"), "{output_str}");
61+
assert!(output_str.contains("\n.TH coreutils"), "{output_str}");
6162
assert!(output_str.contains("coreutils"), "{output_str}");
63+
assert!(output_str.contains("\n.SH NAME\ncoreutils"), "{output_str}");
6264
}
6365

6466
#[test]

0 commit comments

Comments
 (0)