From e799c7fa7f55b27d78f5bccdddb86f78260bf955 Mon Sep 17 00:00:00 2001 From: Ted Pavlic Date: Mon, 19 Jan 2009 19:46:13 -0500 Subject: [PATCH] Make bash completion fail to bashdefault before default completion. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If "-o bashdefault" isn't possible, use old "-o default" only. (this patch inspired by similar mechanism in Mercurial bash completion script) Signed-off-by: Ted Pavlic Signed-off-by: Karl Hasselström --- stgit/completion.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stgit/completion.py b/stgit/completion.py index b3fd282..38f0670 100644 --- a/stgit/completion.py +++ b/stgit/completion.py @@ -129,7 +129,8 @@ def main_switch(commands): 'esac') def install(): - return ['complete -o default -F _stg stg'] + return ['complete -o bashdefault -o default -F _stg stg 2>/dev/null \\', [ + '|| complete -o default -F _stg stg' ] ] def write_completion(f): commands = stgit.commands.get_commands(allow_cached = False) -- 2.11.0