completions: bash: add simple init competion

Populate the _meson-init() completion function.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
pull/10827/head
Liam Beguin 2 years ago committed by Xavier Claessens
parent 3f86f19f95
commit 020e16a2b5
  1. 36
      data/shell-completions/bash/meson

@ -301,7 +301,41 @@ _meson-introspect() {
}
_meson-init() {
: TODO
shortopts=(
h
C
n
e
e
d
l
b
f
)
longopts=(
help
name
executable
deps
language
builddir
force
type
version
)
if [[ "$cur" == "--"* ]]; then
COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}"))
elif [[ "$cur" == "-"* && ${#cur} -gt 1 ]]; then
COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}' -- "${cur:1}"))
else
if [ -z "$cur" ]; then
COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}'))
COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}'))
fi
fi
}
_meson-test() {

Loading…
Cancel
Save