diff options
author | Eric Engestrom <eric@engestrom.ch> | 2017-12-17 21:06:07 +0000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-08 01:59:36 +0200 |
commit | b5cc01ccd99f2aec46768c0d2a1758d9d3317cef (patch) | |
tree | 4fb8bee385ff14a19d7b636a0b980905ed0ce420 /data/shell-completions | |
parent | cb614e8ff6c7b0775686c846c5b6e12a332c76fc (diff) | |
download | meson-b5cc01ccd99f2aec46768c0d2a1758d9d3317cef.zip meson-b5cc01ccd99f2aec46768c0d2a1758d9d3317cef.tar.gz meson-b5cc01ccd99f2aec46768c0d2a1758d9d3317cef.tar.bz2 |
bash/zsh: drop completion for deprecated command
Diffstat (limited to 'data/shell-completions')
-rw-r--r-- | data/shell-completions/bash/meson | 27 | ||||
-rw-r--r-- | data/shell-completions/zsh/_meson | 16 |
2 files changed, 1 insertions, 42 deletions
diff --git a/data/shell-completions/bash/meson b/data/shell-completions/bash/meson index d757e96..993885b 100644 --- a/data/shell-completions/bash/meson +++ b/data/shell-completions/bash/meson @@ -375,7 +375,6 @@ _meson-introspect() { longopts=( targets installed - target-files buildsystem-files buildoptions tests @@ -385,31 +384,7 @@ _meson-introspect() { ) local cur prev - if _get_comp_words_by_ref cur prev &>/dev/null; then - case $prev in - --target-files) - for i in "${!COMP_WORDS[@]}"; do - opt="${COMP_WORDS[i]}" - dir="${COMP_WORDS[i+1]}" - case "$opt" in - -C) - break - ;; - esac - dir=. - done - tests_json=$(meson introspect "$dir" --targets) - if [ $? -eq 0 ]; then - tests=$(python3 -c 'import sys, json -for target in json.load(sys.stdin): - print(target["id"]) -' <<< "$tests_json") - COMPREPLY=($(compgen -W '$tests' -- "$cur")) - fi - return - ;; - esac - else + if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi diff --git a/data/shell-completions/zsh/_meson b/data/shell-completions/zsh/_meson index b48b0f8..49860d5 100644 --- a/data/shell-completions/zsh/_meson +++ b/data/shell-completions/zsh/_meson @@ -50,21 +50,6 @@ local -a meson_commands=( # TODO: implement build option completion (( $+functions[__meson_build_options] )) || __meson_build_options() {} -(( $+functions[__meson_targets] )) || __meson_targets() { - local tests_json - # TODO: get builddir out of the cmdline and pass it here - if tests_json="$(_call_program meson meson introspect --targets)"; - then - local -a tests_ids=$(_call_program python3 python3 -c 'import sys, json; -for target in json.load(sys.stdin): - print(target["id"]) -' <<< "$tests_json") - _describe -t "tests" "Meson tests IDs" tests_ids - else - _message -r "current working directory is not a build directory" - fi -} - # `meson introspect` currently can provide that information in JSON. # We can: # 1) pipe its output to python3 -m json.tool | grep "$alovelyregex" | cut <...> @@ -184,7 +169,6 @@ for target in json.load(sys.stdin): local -a specs=( '--targets[list top level targets]' '--installed[list all installed files and directories]' - '--target-files[list source files for a given target]:target:__meson_targets' '--buildsystem-files[list files that belong to the build system]' '--buildoptions[list all build options]' '--tests[list all unit tests]' |