summaryrefslogtreecommitdiff
path: root/completions/p4
diff options
context:
space:
mode:
Diffstat (limited to 'completions/p4')
-rw-r--r--completions/p434
1 files changed, 17 insertions, 17 deletions
diff --git a/completions/p4 b/completions/p4
index e383c8cf..ed5f20c2 100644
--- a/completions/p4
+++ b/completions/p4
@@ -14,38 +14,38 @@ _p4()
uresource uxbinary xbinary xltext xtempobj xtext \
text binary resource"
- if [[ $cword -eq 1 ]]; then
- COMPREPLY=( $(compgen -W "$p4commands" -- "$cur") )
- elif [[ $cword -eq 2 ]]; then
+ if ((cword == 1)); then
+ COMPREPLY=($(compgen -W "$p4commands" -- "$cur"))
+ elif ((cword == 2)); then
case $prev in
help)
- COMPREPLY=( $(compgen -W "simple commands environment
+ COMPREPLY=($(compgen -W "simple commands environment
filetypes jobview revisions usage views $p4commands" \
- -- "$cur") )
+ -- "$cur"))
;;
admin)
- COMPREPLY=( $(compgen -W "checkpoint stop" -- "$cur") )
- ;;
- *)
+ COMPREPLY=($(compgen -W "checkpoint stop" -- "$cur"))
;;
+ *) ;;
+
esac
- elif [[ $cword -gt 2 ]]; then
+ elif ((cword > 2)); then
case $prev in
-t)
- case ${words[$cword-2]} in
- add|edit|reopen)
- COMPREPLY=( $(compgen -W "$p4filetypes" -- "$cur") )
- ;;
- *)
+ case ${words[cword - 2]} in
+ add | edit | reopen)
+ COMPREPLY=($(compgen -W "$p4filetypes" -- "$cur"))
;;
+ *) ;;
+
esac
;;
- *)
- ;;
+ *) ;;
+
esac
fi
} &&
-complete -F _p4 -o default p4 g4
+ complete -F _p4 -o default p4 g4
# ex: filetype=sh