summaryrefslogtreecommitdiffstats
path: root/completions/xgamma
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/xgamma
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/xgamma')
-rw-r--r--completions/xgamma21
1 files changed, 10 insertions, 11 deletions
diff --git a/completions/xgamma b/completions/xgamma
index 8d77ba3..2a0c409 100644
--- a/completions/xgamma
+++ b/completions/xgamma
@@ -1,15 +1,15 @@
# bash completion for xgamma(1) -*- shell-script -*-
-_xgamma()
+_comp_cmd_xgamma()
{
- local cur prev words cword
- _init_completion -n : || return
+ local cur prev words cword comp_args
+ _comp_initialize -n : -- "$@" || return
case "$prev" in
-screen)
local screens=$(xrandr --query 2>/dev/null | command sed -n \
'/^Screen /s|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null)
- COMPREPLY=($(compgen -W "$screens" -- "$cur"))
+ _comp_compgen -- -W "$screens"
return
;;
-gamma | -rgamma | -ggamma | -bgamma)
@@ -17,7 +17,7 @@ _xgamma()
if [[ $cur && $cur != *.* ]]; then
COMPREPLY=(.)
fi
- COMPREPLY+=($(compgen -W "{0..9}"))
+ _comp_compgen -aR -- -W "{0..9}"
compopt -o nospace
return
;;
@@ -26,18 +26,17 @@ _xgamma()
if [[ $cur == :* && $cur != :*.* ]]; then
# FIXME: where to get local display numbers?
local display=${cur#:}
- COMPREPLY=($(compgen -W "${display:-0}."))
+ _comp_compgen -R -- -W "${display:-0}."
compopt -o nospace
elif [[ $cur == :*.* ]]; then
# local screen numbers
local t screens=$(xrandr --query 2>/dev/null | command sed -ne \
'/^Screen /s|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null)
t="${cur#:}"
- COMPREPLY=($(compgen -P "${t%.*}." -W "$screens" -- \
- "${cur##*.}"))
+ _comp_compgen -c "${cur##*.}" -- -P "${t%.*}." -W '$screens'
elif [[ $cur != *:* ]]; then
# complete hostnames
- _known_hosts_real -c -- "$cur"
+ _comp_compgen_known_hosts -c -- "$cur"
if [[ ! $cur ]]; then
COMPREPLY+=(:)
fi
@@ -49,13 +48,13 @@ _xgamma()
esac
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '$(_parse_help "$1" -help)' -- "$cur"))
+ _comp_compgen_help -- -help
if [[ ${COMPREPLY-} ]]; then
[[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
fi
} &&
- complete -F _xgamma xgamma
+ complete -F _comp_cmd_xgamma xgamma
# ex: filetype=sh