aboutsummaryrefslogtreecommitdiff
path: root/data/shell-completions/bash
diff options
context:
space:
mode:
authorLiam Beguin <liambeguin@gmail.com>2022-09-15 10:58:43 -0400
committerXavier Claessens <xclaesse@gmail.com>2022-09-18 15:22:48 -0400
commit020e16a2b56f8551d9a6c0b81469790883c9096e (patch)
treecadd514f4c06cf4dbd2cc8806362c7ba5fe626f1 /data/shell-completions/bash
parent3f86f19f95d36f2e489a25e1996ab2e2d43079ae (diff)
downloadmeson-020e16a2b56f8551d9a6c0b81469790883c9096e.zip
meson-020e16a2b56f8551d9a6c0b81469790883c9096e.tar.gz
meson-020e16a2b56f8551d9a6c0b81469790883c9096e.tar.bz2
completions: bash: add simple init competion
Populate the _meson-init() completion function. Signed-off-by: Liam Beguin <liambeguin@gmail.com>
Diffstat (limited to 'data/shell-completions/bash')
-rw-r--r--data/shell-completions/bash/meson36
1 files changed, 35 insertions, 1 deletions
diff --git a/data/shell-completions/bash/meson b/data/shell-completions/bash/meson
index 9004981..4357a3f 100644
--- a/data/shell-completions/bash/meson
+++ b/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() {