From 72f58b3bc71989fb4805854a2d48fd8f64906b49 Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Fri, 25 Nov 2022 13:04:44 +0100 Subject: bash completion: suppress stderr produced when using -D option... ...and while there, avoid a bit of code duplication --- share/just-mr_complete.bash | 29 ++--------------------------- share/just_complete.bash | 2 +- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/share/just-mr_complete.bash b/share/just-mr_complete.bash index c8d3f4f1..4fc69f33 100644 --- a/share/just-mr_complete.bash +++ b/share/just-mr_complete.bash @@ -35,32 +35,7 @@ if path.exists("$CONF"): EOF } -_just-mr_targets(){ - command -v python3 &>/dev/null || return - python3 - </dev/null)) COMPREPLY=($(compgen -f -W "${_opts[*]} ${_targets[*]}" -- $word )) compopt -o plusdirs -o bashdefault -o default else diff --git a/share/just_complete.bash b/share/just_complete.bash index 51a7e5e3..41f8f5aa 100644 --- a/share/just_complete.bash +++ b/share/just_complete.bash @@ -46,7 +46,7 @@ _just_completion(){ elif [[ $cmd =~ ^(build|analyse|describe|install-cas|install|rebuild) ]] then local _opts=($(_just_subcommand_options $cmd)) - local _targets=($(_just_targets $prev)) + local _targets=($(_just_targets $prev 2>/dev/null)) COMPREPLY=($(compgen -f -W "${_opts[*]} ${_targets[*]}" -- $word )) compopt -o plusdirs -o bashdefault -o default else -- cgit v1.2.3