diff options
author | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
---|---|---|
committer | Gabriel F. T. Gomes <gabriel@inconstante.net.br> | 2020-08-03 18:43:13 -0300 |
commit | 95623d39d6029ba78ec96ad5ea08e9ac12629b91 (patch) | |
tree | ea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /completions/p4 | |
parent | 019f3cc463db63abc6460f97deb488deec43840b (diff) | |
download | bash-completion-upstream.tar.gz |
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'completions/p4')
-rw-r--r-- | completions/p4 | 34 |
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 |