From 4835a2b1952d6f7c21b6a02cf27b31f79fe89a25 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Tue, 15 Apr 2014 14:27:37 +0700 Subject: =?UTF-8?q?Expand=20the=20-C=20argument=20via=20=E2=80=98eval?= =?UTF-8?q?=E2=80=99=20in=20bash=20completion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously completion would not work for ‘ninja -C $HOME/Source/foo targ‸’. We still do not support using tilde in the directory argument. --- misc/bash-completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/bash-completion b/misc/bash-completion index 93bc9a1..719e7a8 100644 --- a/misc/bash-completion +++ b/misc/bash-completion @@ -31,7 +31,7 @@ _ninja_target() { 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 -- cgit v0.12