Skip to content

Commit

Permalink
multicall: add --list to list all utils
Browse files Browse the repository at this point in the history
  • Loading branch information
tertsdiepraam authored and sylvestre committed Apr 30, 2024
1 parent 1162c53 commit b1ba249
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/bin/coreutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,20 @@ fn main() {
None => not_found(&util_os),
};

if util == "completion" {
gen_completions(args, &utils);
}

if util == "manpage" {
gen_manpage(args, &utils);
}
match util {
"completion" => gen_completions(args, &utils),
"manpage" => gen_manpage(args, &utils),
"--list" => {
let mut utils: Vec<_> = utils.keys().collect();
utils.sort();

Check warning on line 98 in src/bin/coreutils.rs

View check run for this annotation

Codecov / codecov/patch

src/bin/coreutils.rs#L97-L98

Added lines #L97 - L98 were not covered by tests
for util in utils {
println!("{util}");
}
process::exit(0);

Check warning on line 102 in src/bin/coreutils.rs

View check run for this annotation

Codecov / codecov/patch

src/bin/coreutils.rs#L100-L102

Added lines #L100 - L102 were not covered by tests
}
// Not a special command: fallthrough to calling a util
_ => {}
};

match utils.get(util) {
Some(&(uumain, _)) => {
Expand Down

0 comments on commit b1ba249

Please sign in to comment.