Skip to content

Commit

Permalink
Adds -Xprint-args internal flag to tree_shaker, only needed for debug…
Browse files Browse the repository at this point in the history
…ging build rules.

PiperOrigin-RevId: 364890336
  • Loading branch information
tomball authored and copybara-github committed Mar 24, 2021
1 parent 610f643 commit 344bbe1
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public static void version() {

public static Options parse(String[] args) throws IOException {
Options options = new Options();
boolean printArgs = false;

int nArg = 0;
while (nArg < args.length) {
Expand Down Expand Up @@ -204,6 +205,8 @@ public static Options parse(String[] args) throws IOException {
version();
} else if (arg.equals("-Werror")) {
options.treatWarningsAsErrors = true;
} else if (arg.equals("-Xprint-args")) {
printArgs = true;
} else if (arg.startsWith("-h") || arg.equals("--help")) {
help(false);
} else if (arg.startsWith("-")) {
Expand All @@ -220,6 +223,10 @@ public static Options parse(String[] args) throws IOException {
if (options.sourceFiles.isEmpty()) {
usage("no source files");
}
if (printArgs) {
System.err.print("tree_shaker ");
System.err.println(String.join(" ", args));
}

return options;
}
Expand Down

0 comments on commit 344bbe1

Please sign in to comment.