summaryrefslogtreecommitdiffstats
path: root/completions/dot
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:19 +0000
commit6c09f2a45c5541e9c207d14fc7aa21a4a0066bde (patch)
tree0221189d367bf661f6f9493c4f17a03f0dd4b7d2 /completions/dot
parentReleasing progress-linux version 1:2.11-8~progress7.99u1. (diff)
downloadbash-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/dot')
-rw-r--r--completions/dot33
1 files changed, 17 insertions, 16 deletions
diff --git a/completions/dot b/completions/dot
index 8122229..dcb8436 100644
--- a/completions/dot
+++ b/completions/dot
@@ -1,9 +1,9 @@
# dot(1) completion -*- shell-script -*-
-_dot()
+_comp_cmd_dot()
{
- local cur prev words cword
- _init_completion -n := || return
+ local cur prev words cword comp_args
+ _comp_initialize -n := -- "$@" || return
[[ $prev == -[V?] ]] && return
@@ -12,34 +12,35 @@ _dot()
return
;;
-T*)
- local langs=($("$1" -TNON_EXISTENT 2>&1 |
- command sed -ne 's/.*one of://p'))
- COMPREPLY=($(compgen -P -T -W '${langs[@]}' -- "${cur#-T}"))
+ # generate langs
+ _comp_compgen -c "${cur#-T}" split -P "-T" -- "$(
+ "$1" -TNON_EXISTENT 2>&1 | command sed -ne 's/.*one of://p'
+ )"
return
;;
-K*)
- local layouts=($("$1" -KNON_EXISTENT 2>&1 |
- command sed -ne 's/.*one of://p'))
- COMPREPLY=($(compgen -P -K -W '${layouts[@]}' -- "${cur#-K}"))
+ # generate layouts
+ _comp_compgen -c "${cur#-K}" split -P "-K" -- "$(
+ "$1" -KNON_EXISTENT 2>&1 | command sed -ne 's/.*one of://p'
+ )"
return
;;
-o*)
- cur=${cur#-o}
- _filedir
- COMPREPLY=($(compgen -P -o -W '${COMPREPLY[@]}' -- "$cur"))
+ _comp_compgen -c "${cur#-o}" filedir &&
+ COMPREPLY=("${COMPREPLY[@]/#/-o}")
return
;;
esac
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '-V -v -G -N -E -T -K -l -o -O -P -q -s -y -n
- -n1 -n2 -x -Lg -LO -Ln -LU -LC -LT -m -c -?' -- "$cur"))
+ _comp_compgen -- -W '-V -v -G -N -E -T -K -l -o -O -P -q -s -y -n -n1
+ -n2 -x -Lg -LO -Ln -LU -LC -LT -m -c -?'
[[ ${COMPREPLY-} == -@([GNETKo]|L[nUCT]) ]] && compopt -o nospace
return
fi
- _filedir dot
+ _comp_compgen_filedir '@(gv|dot)'
} &&
- complete -F _dot dot
+ complete -F _comp_cmd_dot dot
# ex: filetype=sh