diff options
-rw-r--r-- | misc/bash-completion | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/misc/bash-completion b/misc/bash-completion index 2d6975b..719e7a8 100644 --- a/misc/bash-completion +++ b/misc/bash-completion @@ -26,12 +26,12 @@ _ninja_target() { dir="." line=$(echo ${COMP_LINE} | cut -d" " -f 2-) # filter out all non relevant arguments but keep C for dirs - while getopts C:f:j:l:k:nvd:t: opt "${line[@]}"; do + while getopts C:f:j:l:k:nvd:t: opt $line; do case $opt in C) dir="$OPTARG" ;; esac done; - targets_command="ninja -C ${dir} -t targets all" + targets_command="eval ninja -C \"${dir}\" -t targets all" targets=$((${targets_command} 2>/dev/null) | awk -F: '{print $1}') COMPREPLY=($(compgen -W "$targets" -- "$cur")) fi |