~mdw
/
tig
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reload the status and stage views after a run request has been handled
[tig]
/
contrib
/
tig-completion.bash
diff --git
a/contrib/tig-completion.bash
b/contrib/tig-completion.bash
index
3b6fd6d
..
79b414b
100755
(executable)
--- a/
contrib/tig-completion.bash
+++ b/
contrib/tig-completion.bash
@@
-43,7
+43,7
@@
__tigdir ()
fi
}
fi
}
-tigcomp ()
+
_
tigcomp ()
{
local all c s=$'\n' IFS=' '$'\t'$'\n'
local cur="${COMP_WORDS[COMP_CWORD]}"
{
local all c s=$'\n' IFS=' '$'\t'$'\n'
local cur="${COMP_WORDS[COMP_CWORD]}"
@@
-120,7
+120,7
@@
__tig_complete_file ()
-- "$cur"))
;;
*)
-- "$cur"))
;;
*)
- tigcomp "$(__tig_refs)"
+
_
tigcomp "$(__tig_refs)"
;;
esac
}
;;
esac
}
@@
-132,39
+132,34
@@
__tig_complete_revlist ()
*...*)
pfx="${cur%...*}..."
cur="${cur#*...}"
*...*)
pfx="${cur%...*}..."
cur="${cur#*...}"
- tigcomp "$(__tig_refs)" "$pfx" "$cur"
+
_
tigcomp "$(__tig_refs)" "$pfx" "$cur"
;;
*..*)
pfx="${cur%..*}.."
cur="${cur#*..}"
;;
*..*)
pfx="${cur%..*}.."
cur="${cur#*..}"
- tigcomp "$(__tig_refs)" "$pfx" "$cur"
+
_
tigcomp "$(__tig_refs)" "$pfx" "$cur"
;;
*.)
;;
*.)
- tigcomp "$cur."
+
_
tigcomp "$cur."
;;
*)
;;
*)
- tigcomp "$(__tig_refs)"
+
_
tigcomp "$(__tig_refs)"
;;
esac
}
;;
esac
}
-_tig_diff ()
-{
- __tig_complete_file
-}
-
-_tig_log ()
+_tig_options ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
{
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
- tigcomp "
+
_
tigcomp "
oneline short medium full fuller email raw
" "" "${cur##--pretty=}"
return
;;
--*)
oneline short medium full fuller email raw
" "" "${cur##--pretty=}"
return
;;
--*)
- tigcomp "
+
_
tigcomp "
--max-count= --max-age= --since= --after=
--min-age= --before= --until=
--root --not --topo-order --date-order
--max-count= --max-age= --since= --after=
--min-age= --before= --until=
--root --not --topo-order --date-order
@@
-175,9
+170,14
@@
_tig_log ()
--all-match
--pretty= --name-status --name-only
--not --all
--all-match
--pretty= --name-status --name-only
--not --all
+ --help --version
"
return
;;
"
return
;;
+ -*)
+ _tigcomp "-v -h"
+ return
+ ;;
esac
__tig_complete_revlist
}
esac
__tig_complete_revlist
}
@@
-187,13
+187,13
@@
_tig_show ()
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
- tigcomp "
+
_
tigcomp "
oneline short medium full fuller email raw
" "" "${cur##--pretty=}"
return
;;
--*)
oneline short medium full fuller email raw
" "" "${cur##--pretty=}"
return
;;
--*)
- tigcomp "--pretty="
+
_
tigcomp "--pretty="
return
;;
esac
return
;;
esac
@@
-217,20
+217,16
@@
_tig ()
if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
case "${COMP_WORDS[COMP_CWORD]}" in
--*=*) COMPREPLY=() ;;
if [ $c -eq $COMP_CWORD -a -z "$command" ]; then
case "${COMP_WORDS[COMP_CWORD]}" in
--*=*) COMPREPLY=() ;;
- -*) tigcomp "
- --line-number= --tab-size= --version --help
- -b -d -h -l -S -v
- " ;;
- *) tigcomp "log diff show $(__tig_refs)" ;;
+ -*) _tig_options ;;
+ *) _tigcomp "status show $(__tig_refs)" ;;
esac
return
fi
case "$command" in
esac
return
fi
case "$command" in
- diff) _tig_diff ;;
show) _tig_show ;;
show) _tig_show ;;
-
log) _tig_log
;;
- *) tigcomp "
+
status)
;;
+ *)
_
tigcomp "
$(__tig_complete_file)
$(__tig_refs)
" ;;
$(__tig_complete_file)
$(__tig_refs)
" ;;