summaryrefslogtreecommitdiffstats
path: root/completions/fbi
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/fbi
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/fbi')
-rw-r--r--completions/fbi36
1 files changed, 17 insertions, 19 deletions
diff --git a/completions/fbi b/completions/fbi
index 455887a..275395e 100644
--- a/completions/fbi
+++ b/completions/fbi
@@ -1,32 +1,31 @@
# bash completion for fbi(1) -*- shell-script -*-
-_fbi()
+_comp_cmd_fbi()
{
- local cur prev words cword
- _init_completion || return
+ local cur prev words cword comp_args
+ _comp_initialize -- "$@" || return
case "$prev" in
-l | --list)
- _filedir
+ _comp_compgen_filedir
return
;;
-r | --resolution)
- COMPREPLY+=($(compgen -W '{1..5}'))
+ _comp_compgen -aR -- -W '{1..5}'
return
;;
-f | --font)
- local IFS=$'\n'
- COMPREPLY=($(compgen -W '$(fc-list 2>/dev/null)' -- "$cur"))
+ _comp_compgen_split -l -- "$(fc-list 2>/dev/null)"
return
;;
-m | --mode)
- COMPREPLY=($(compgen -W '$(command sed \
- -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \
- /etc/fb.modes 2>/dev/null)' -- "$cur"))
+ _comp_compgen_split -- "$(command sed \
+ -n '/^mode/{s/^mode \{1,\}"\([^"]\{1,\}\)"/\1/g;p}' \
+ /etc/fb.modes 2>/dev/null)"
return
;;
-d | --device)
- COMPREPLY=($(compgen -f -d -- "${cur:-/dev/}"))
+ _comp_compgen -c "${cur:-/dev/}" -- -f -d
return
;;
--cachemem | --blend | -T | --vt | -s | --scroll | -t | --timeout | -g | --gamma)
@@ -36,19 +35,18 @@ _fbi()
esac
if [[ $cur == -* ]]; then
- COMPREPLY=($(compgen -W '--help --version --store --list --text
- --autozoom --{,no}autoup --{,no}autodown --{,no}fitwidth
- --{,no}verbose --{,no}random --{,no}comments --{,no}edit
- --{,no}backup --{,no}preserve --{,no}readahead --cachemem --blend
- --vt --scroll --timeout --{,no}once --resolution --gamma --font
- --device --mode' -- "$cur"))
+ _comp_compgen -- -W '--help --version --store --list --text --autozoom
+ --{,no}autoup --{,no}autodown --{,no}fitwidth --{,no}verbose
+ --{,no}random --{,no}comments --{,no}edit --{,no}backup
+ --{,no}preserve --{,no}readahead --cachemem --blend --vt --scroll
+ --timeout --{,no}once --resolution --gamma --font --device --mode'
[[ ${COMPREPLY-} ]] && return
fi
# FIXME: It is hard to determine correct supported extensions.
# fbi can handle any format that imagemagick can plus some others
- _filedir 'bmp|gif|jp?(e)g|pcd|png|p[pgb]m|tif?(f)|webp|xpm|xwd|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf'
+ _comp_compgen_filedir 'bmp|gif|jp?(e)g|pcd|png|p[pgb]m|tif?(f)|webp|xpm|xwd|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf'
} &&
- complete -F _fbi fbi
+ complete -F _comp_cmd_fbi fbi
# ex: filetype=sh