[StGit PATCH 2/2] Make bash completion fail to bashdefault before default completion.
- From
ted@tedpavlic.com <ted@tedpavlic.com>
- Date
- Jan 20, 2009, 00:46 UTC
- Message-ID
- <1232412373-10836-2-git-send-email-ted@tedpavlic.com>
- In-Reply-To
- <1232412373-10836-1-git-send-email-ted@tedpavlic.com>
From: Ted Pavlic <ted@tedpavlic.com>
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 <ted@tedpavlic.com> --- stgit/completion.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/stgit/completion.py b/stgit/completion.py index b3fd282..56e81c2 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)
-- 1.6.1.87.g15624