From 2820c7a9cd1b9907b1a4dba0163d6d8bcb2c73eb Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Tue, 2 Sep 2014 15:10:52 -0700 Subject: [PATCH] Erase all completions with `complete -c foo -e` When passing `-e` to `complete -c foo` without any other options, all options for the command should be erased. Fixes #380. --- builtin_complete.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builtin_complete.cpp b/builtin_complete.cpp index e306c739c..691fad2b7 100644 --- a/builtin_complete.cpp +++ b/builtin_complete.cpp @@ -224,6 +224,14 @@ static void builtin_complete_remove2(const wchar_t *cmd, } } } + else if (gnu_opt.empty() && old_opt.empty()) + { + complete_remove(cmd, + cmd_type, + 0, + 0, + 0); + } else { builtin_complete_remove3(cmd,