aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin_complete.cpp
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-09-02 15:10:52 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-09-02 15:30:58 -0700
commit2820c7a9cd1b9907b1a4dba0163d6d8bcb2c73eb (patch)
tree738b832e75bc5aecc9cb922cf88fb86ba775c278 /builtin_complete.cpp
parentedd4f3d5adb6b532ebc0e6633915613b39d0dba5 (diff)
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.
Diffstat (limited to 'builtin_complete.cpp')
-rw-r--r--builtin_complete.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin_complete.cpp b/builtin_complete.cpp
index e306c739..691fad2b 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,