Skip to content

Commit

Permalink
Expand the -C argument via ‘eval’ in bash completion
Browse files Browse the repository at this point in the history
Previously completion would not work for ‘ninja -C $HOME/Source/foo targ‸’.

We still do not support using tilde in the directory argument.
  • Loading branch information
sorbits committed Apr 15, 2014
1 parent 1f38478 commit 4835a2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion misc/bash-completion
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4835a2b

Please sign in to comment.