From 07c1f9b14b5f7071a5def7d09414ec852a4372ef Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Thu, 13 Oct 2011 18:00:47 -0700 Subject: pass extra flags into the tool --- src/ninja.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ninja.cc b/src/ninja.cc index 6dc2766..5e8d2e4 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -62,7 +62,9 @@ void Usage(const BuildConfig& config) { " -v show all command lines\n" " -C DIR change to DIR before doing anything else\n" "\n" -" -t TOOL run a subtool. tools are:\n" +" -t TOOL run a subtool.\n" +" terminates toplevel options; further flags are passed to the tool.\n" +" tools are:\n" " browse browse dependency graph in a web browser\n" " graph output graphviz dot file for targets\n" " query show inputs/outputs for a path\n" @@ -402,7 +404,8 @@ int main(int argc, char** argv) { }; int opt; - while ((opt = getopt_long(argc, argv, "f:hj:k:nt:vC:", kLongOptions, + while (tool.empty() && + (opt = getopt_long(argc, argv, "f:hj:k:nt:vC:", kLongOptions, NULL)) != -1) { switch (opt) { case 'f': -- cgit v0.12