diff --git a/src/completions/bash.rs b/src/completions/bash.rs index bd4c8c8b..8da517b2 100644 --- a/src/completions/bash.rs +++ b/src/completions/bash.rs @@ -58,7 +58,7 @@ impl<'a, 'b> BashGen<'a, 'b> { esac }} -complete -F _{name} {name} +complete -F _{name} -o bashdefault -o default {name} ", name = self.p.meta.bin_name.as_ref().unwrap(), name_opts = self.all_options_for_path(self.p.meta.bin_name.as_ref().unwrap()), diff --git a/tests/completions.rs b/tests/completions.rs index c0242322..6aa99f5d 100644 --- a/tests/completions.rs +++ b/tests/completions.rs @@ -21,5 +21,5 @@ fn test_generation() { let last_line = string.lines().rev().nth(0).unwrap(); assert_eq!(first_line, "_myapp() {"); - assert_eq!(last_line, "complete -F _myapp myapp"); + assert_eq!(last_line, "complete -F _myapp -o bashdefault -o default myapp"); }