From 6a62d4912216fa6413326dafdbfdac5e98afbe43 Mon Sep 17 00:00:00 2001 From: Luke Elliott Date: Fri, 17 Feb 2023 18:22:03 +0000 Subject: [PATCH] completions: bash: added a bunch of missing completion options. --- data/shell-completions/bash/meson | 179 +++++++++++++++++++++++------- 1 file changed, 137 insertions(+), 42 deletions(-) diff --git a/data/shell-completions/bash/meson b/data/shell-completions/bash/meson index 4357a3f68..b1cbe81fd 100644 --- a/data/shell-completions/bash/meson +++ b/data/shell-completions/bash/meson @@ -103,20 +103,28 @@ _meson_complete_filedir() { cur=$2 case $option in prefix |\ - libdir |\ - libexecdir |\ bindir |\ - sbindir |\ - includedir |\ datadir |\ - mandir |\ + includedir |\ infodir |\ + libdir |\ + licensedir |\ + libexecdir |\ localedir |\ - sysconfdir |\ localstatedir |\ - sharedstatedir) + mandir |\ + sbindir |\ + sharedstatedir |\ + sysconfdir |\ + python.platlibdir |\ + python.purelibdir |\ + pkg-config-path |\ + build.pkg-config-path |\ + cmake-prefix-path |\ + build.cmake-prefix-path) _filedir -d ;; + cross-file) _filedir COMPREPLY+=($(_filedir_in "$XDG_DATA_DIRS"/meson/cross)) @@ -125,6 +133,16 @@ _meson_complete_filedir() { COMPREPLY+=($(_filedir_in "$XDG_DATA_HOME"/meson/cross)) COMPREPLY+=($(_filedir_in ~/.local/share/meson/cross)) ;; + + native-file) + _filedir + COMPREPLY+=($(_filedir_in "$XDG_DATA_DIRS"/meson/native)) + COMPREPLY+=($(_filedir_in /usr/local/share/meson/native)) + COMPREPLY+=($(_filedir_in /usr/share/meson/native)) + COMPREPLY+=($(_filedir_in "$XDG_DATA_HOME"/meson/native)) + COMPREPLY+=($(_filedir_in ~/.local/share/meson/native)) + ;; + *) return 1;; esac @@ -132,41 +150,63 @@ _meson_complete_filedir() { } _meson-setup() { - shortopts=( h D v ) + # backend-startup-project is currently VS backend only. + longopts=( help prefix - libdir - libexecdir bindir - sbindir - includedir datadir - mandir + includedir infodir + libdir + libexecdir + licensedir localedir - sysconfdir localstatedir + mandir + sbindir sharedstatedir + sysconfdir + auto-features backend buildtype + debug + default-library + errorlogs + install-umask + layout + optimization + prefer-static + stdsplit strip unity - werror - layout - default-library + unity-size warnlevel - stdsplit - errorlogs + werror + wrap-mode + force-fallback-for + pkgconfig.relocatable + python.install-env + python.platlibdir + python.purelibdir + pkg-config-path + build.pkg-config-path + cmake-prefix-path + build.cmake-prefix-path + native-file cross-file + vsenv version - wrap-mode + fatal-meson-warnings + reconfigure + wipe ) local cur prev @@ -204,7 +244,6 @@ _meson-setup() { } _meson-configure() { - shortopts=( h D @@ -212,7 +251,49 @@ _meson-configure() { longopts=( help + prefix + bindir + datadir + includedir + infodir + libdir + libexecdir + licensedir + localedir + localstatedir + mandir + sbindir + sharedstatedir + sysconfdir + auto-features + backend + buildtype + debug + default-library + errorlogs + install-umask + layout + optimization + prefer-static + stdsplit + strip + unity + unity-size + warnlevel + werror + wrap-mode + force-fallback-for + backend-startup-project + pkgconfig.relocatable + python.install-env + python.platlibdir + python.purelibdir + pkg-config-path + build.pkg-config-path + cmake-prefix-path + build.cmake-prefix-path clearcache + no-pager ) local cur prev @@ -259,17 +340,27 @@ _meson-install() { _meson-introspect() { shortopts=( h + a + i + f ) longopts=( - targets - installed - buildsystem-files - buildoptions - tests + ast benchmarks + buildoptions + buildsystem-files dependencies + scan-dependencies + installed + install-plan projectinfo + targets + tests + backend + all + indent + force-object-output ) local cur prev @@ -306,7 +397,6 @@ _meson-init() { C n e - e d l b @@ -315,14 +405,15 @@ _meson-init() { longopts=( help - name - executable - deps - language - builddir - force - type - version + name + executable + deps + language + build + builddir + force + type + version ) if [[ "$cur" == "--"* ]]; then @@ -340,6 +431,7 @@ _meson-init() { _meson-test() { shortopts=( + h q v t @@ -347,21 +439,24 @@ _meson-test() { ) longopts=( - quiet - verbose - timeout-multiplier + help + maxfail repeat no-rebuild gdb + gdb-path list - wrapper --wrap - no-suite + wrapper suite + no-suite no-stdsplit print-errorlogs benchmark logbase num-processes + verbose + quiet + timeout-multiplier setup test-args ) @@ -369,7 +464,7 @@ _meson-test() { local cur prev if _get_comp_words_by_ref -n ':' cur prev &>/dev/null; then case $prev in - --repeat) + --maxfail | --repeat) # number, can't be completed return ;; @@ -377,7 +472,7 @@ _meson-test() { _command_offset $COMP_CWORD return ;; - -C) + --gdb-path | -C) _filedir -d return ;;