diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:03:19 +0000 |
commit | 6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch) | |
tree | 0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /completions/p4 | |
parent | Releasing progress-linux version 1:2.11-8~progress7.99u1. (diff) | |
download | bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.tar.xz bash-completion-6c09f2a45c5541e9c207d14fc7aa21a4a0066bde.zip |
Merging upstream version 1:2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'completions/p4')
-rw-r--r-- | completions/p4 | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/completions/p4 b/completions/p4 index ed5f20c..5bcadf6 100644 --- a/completions/p4 +++ b/completions/p4 @@ -1,30 +1,29 @@ # Perforce completion -*- shell-script -*- # by Frank Cusack <frank@google.com> -_p4() +_comp_cmd_p4() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return local p4commands p4filetypes # rename isn't really a command - p4commands="$(p4 help commands 2>/dev/null | awk 'NF>3 {print $1}')" + p4commands="$(p4 help commands 2>/dev/null | _comp_awk 'NF>3 {print $1}')" p4filetypes="ctext cxtext ktext kxtext ltext tempobj ubinary \ uresource uxbinary xbinary xltext xtempobj xtext \ text binary resource" if ((cword == 1)); then - COMPREPLY=($(compgen -W "$p4commands" -- "$cur")) + _comp_compgen -- -W "$p4commands" elif ((cword == 2)); then case $prev in help) - COMPREPLY=($(compgen -W "simple commands environment - filetypes jobview revisions usage views $p4commands" \ - -- "$cur")) + _comp_compgen -- -W "simple commands environment filetypes + jobview revisions usage views $p4commands" ;; admin) - COMPREPLY=($(compgen -W "checkpoint stop" -- "$cur")) + _comp_compgen -- -W "checkpoint stop" ;; *) ;; @@ -34,7 +33,7 @@ _p4() -t) case ${words[cword - 2]} in add | edit | reopen) - COMPREPLY=($(compgen -W "$p4filetypes" -- "$cur")) + _comp_compgen -- -W "$p4filetypes" ;; *) ;; @@ -46,6 +45,6 @@ _p4() fi } && - complete -F _p4 -o default p4 g4 + complete -F _comp_cmd_p4 -o default p4 g4 # ex: filetype=sh |