Skip to content

Commit 83c8517

Browse files
committed
coreutils multicall: the manpage subcommand doesn't display the right command
see https://manpages.debian.org/unstable/rust-coreutils/rust-coreutils.1.en.html
1 parent 7d44e96 commit 83c8517

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/bin/coreutils.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,15 @@ fn gen_manpage<T: uucore::Args>(
212212

213213
fn gen_coreutils_app<T: uucore::Args>(util_map: &UtilityMap<T>) -> Command {
214214
let mut command = Command::new("coreutils");
215-
for (_, (_, sub_app)) in util_map {
216-
command = command.subcommand(sub_app());
215+
for (name, (_, sub_app)) in util_map {
216+
// Recreate a small subcommand with only the relevant info
217+
// (name & short description)
218+
let about = sub_app()
219+
.get_about()
220+
.expect("Could not get the 'about'")
221+
.to_string();
222+
let sub_app = Command::new(name).about(about);
223+
command = command.subcommand(sub_app);
217224
}
218225
command
219226
}

0 commit comments

Comments
 (0)