chiark
/
gitweb
/
~mdw
/
stgit
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the log --clear option
[stgit]
/
stgit
/
completion.py
diff --git
a/stgit/completion.py
b/stgit/completion.py
index affc8c6ed22f17ce1d45d47a5546b3654a479352..38f06705b76aa03a621adb88a87cc9ca8e3b3eb8 100644
(file)
--- a/
stgit/completion.py
+++ b/
stgit/completion.py
@@
-111,19
+111,26
@@
def main_switch(commands):
('# Complete name of subcommand if the user has not finished'
' typing it yet.'),
'if test $c -eq $COMP_CWORD -a -z "$command"; then', [
('# Complete name of subcommand if the user has not finished'
' typing it yet.'),
'if test $c -eq $COMP_CWORD -a -z "$command"; then', [
- ('COMPREPLY=($(compgen -W "$_stg_commands" --'
+ ('COMPREPLY=($(compgen -W "
help version copyright
$_stg_commands" --'
' "${COMP_WORDS[COMP_CWORD]}"))'),
'return'],
'fi',
'',
'# Complete arguments to subcommands.',
'case "$command" in', [
' "${COMP_WORDS[COMP_CWORD]}"))'),
'return'],
'fi',
'',
'# Complete arguments to subcommands.',
'case "$command" in', [
+ 'help) ', [
+ ('COMPREPLY=($(compgen -W "$_stg_commands" --'
+ ' "${COMP_WORDS[COMP_CWORD]}"))'),
+ 'return ;;'],
+ 'version) return ;;',
+ 'copyright) return ;;'], [
'%s) _stg_%s ;;' % (cmd, cmd)
for cmd in sorted(commands.iterkeys())],
'esac')
def install():
'%s) _stg_%s ;;' % (cmd, cmd)
for cmd in sorted(commands.iterkeys())],
'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)
def write_completion(f):
commands = stgit.commands.get_commands(allow_cached = False)