mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
Fix completion with a clap update
This commit is contained in:
parent
52d767ed5a
commit
dc12639995
1 changed files with 1 additions and 2 deletions
|
@ -153,14 +153,13 @@ fn gen_completions<T: uucore::Args>(
|
|||
.get_matches_from(std::iter::once(OsString::from("completion")).chain(args));
|
||||
|
||||
let utility = matches.value_of("utility").unwrap();
|
||||
let shell = matches.value_of("shell").unwrap();
|
||||
let shell = matches.get_one::<Shell>("shell").unwrap().to_owned();
|
||||
|
||||
let mut command = if utility == "coreutils" {
|
||||
gen_coreutils_app(util_map)
|
||||
} else {
|
||||
util_map.get(utility).unwrap().1()
|
||||
};
|
||||
let shell: Shell = shell.parse().unwrap();
|
||||
let bin_name = std::env::var("PROG_PREFIX").unwrap_or_default() + utility;
|
||||
|
||||
clap_complete::generate(shell, &mut command, bin_name, &mut io::stdout());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue