From dc12639995e406c1e4d4c864fccf8515ad33e3ea Mon Sep 17 00:00:00 2001 From: Niyaz Nigmatullin Date: Tue, 16 Aug 2022 17:22:33 +0300 Subject: [PATCH] Fix completion with a clap update --- src/bin/coreutils.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bin/coreutils.rs b/src/bin/coreutils.rs index a6fb11055..c6914db3f 100644 --- a/src/bin/coreutils.rs +++ b/src/bin/coreutils.rs @@ -153,14 +153,13 @@ fn gen_completions( .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").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());