aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2021-07-10 18:52:53 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2021-07-12 18:45:13 +0100
commitb18866a9424745507da9fc6dc5b0e53becef2ab2 (patch)
tree1e433c429da6051471fd3f0cc4aa0b361183e6a5
parente2de20cae38383d4bdc64a05ebc52bd5800733f7 (diff)
downloadwaffle-b18866a9424745507da9fc6dc5b0e53becef2ab2.tar.gz
wflinfo: bash-completion: remove quirky handling
Currently wflinfo supports handling short opts, which are not space separated. Additionally it also handles long-opt separated via =. Neither of which is documented any more - latter was previously. Just keep things simple and remove the extra quirky handling to those. The program still supports them, so any users are unaffected. Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
-rw-r--r--shell-completion/bash/wflinfo23
1 files changed, 5 insertions, 18 deletions
diff --git a/shell-completion/bash/wflinfo b/shell-completion/bash/wflinfo
index c2d3959..68bf025 100644
--- a/shell-completion/bash/wflinfo
+++ b/shell-completion/bash/wflinfo
@@ -2,39 +2,26 @@ _wflinfo() {
local cur prev
if _get_comp_words_by_ref -n= cur prev &>/dev/null; then
- prefix=""
- case $cur in
- -p*|-a*|-V*|-f*)
- prev=${cur:0:2}
- cur=${cur:2}
- prefix="-P $prev"
- ;;
- --platform=*|--api=*|--version=*|--format=*)
- prev=${cur%%=*}
- cur=${cur#*=}
- ;;
- esac
-
case $prev in
-p|--platform)
- COMPREPLY=($(compgen $prefix -W 'android cgl gbm glx surfaceless_egl sl wayland wgl x11_egl' -- "$cur"))
+ COMPREPLY=($(compgen -W 'android cgl gbm glx surfaceless_egl sl wayland wgl x11_egl' -- "$cur"))
return
;;
-a|--api)
- COMPREPLY=($(compgen $prefix -W 'gl gles1 gles2 gles3' -- "$cur"))
+ COMPREPLY=($(compgen -W 'gl gles1 gles2 gles3' -- "$cur"))
return
;;
-V|--version)
local versions=(1.{0..5} 2.{0..1} 3.{0..3} 4.{0..6})
- COMPREPLY=($(compgen $prefix -W "${versions[*]}" -- "$cur"))
+ COMPREPLY=($(compgen -W "${versions[*]}" -- "$cur"))
return
;;
--profile)
- COMPREPLY=($(compgen $prefix -W 'core compat none' -- "$cur"))
+ COMPREPLY=($(compgen -W 'core compat none' -- "$cur"))
return
;;
-f|--format)
- COMPREPLY=($(compgen $prefix -W 'original json' -- "$cur"))
+ COMPREPLY=($(compgen -W 'original json' -- "$cur"))
return
;;
esac