src/cli/command.rs: print_bash_completion - avoid crash

This commit is contained in:
Dietmar Maurer 2019-03-07 12:14:26 +01:00
parent 141f062e08
commit 25e77d3877

View File

@ -574,12 +574,13 @@ pub fn print_bash_completion(def: &CommandLineInterface) {
Err(_) => return,
};
let mut args = match shellwords::split(&cmdline) {
Ok(v) => v,
Err(_) => return,
};
if args.len() == 0 { return; }
args.remove(0); //no need for program name
if cmdline.ends_with(char::is_whitespace) {