summaryrefslogtreecommitdiffstats
path: root/completions/p4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
commitf2621414ee5f2f601424c22f00e207903e3b6104 (patch)
tree56a856dafd1ca684bb23263cacaa723ee4f404fc /completions/p4
parentAdding debian version 1:2.11-8. (diff)
downloadbash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.tar.xz
bash-completion-f2621414ee5f2f601424c22f00e207903e3b6104.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/p421
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