Skip to content

Commit 344bbe1

Browse files
tomballcopybara-github
authored andcommitted
Adds -Xprint-args internal flag to tree_shaker, only needed for debugging build rules.
PiperOrigin-RevId: 364890336
1 parent 610f643 commit 344bbe1

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • tree_shaker/src/main/java/com/google/devtools/treeshaker

tree_shaker/src/main/java/com/google/devtools/treeshaker/Options.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public static void version() {
153153

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

157158
int nArg = 0;
158159
while (nArg < args.length) {
@@ -204,6 +205,8 @@ public static Options parse(String[] args) throws IOException {
204205
version();
205206
} else if (arg.equals("-Werror")) {
206207
options.treatWarningsAsErrors = true;
208+
} else if (arg.equals("-Xprint-args")) {
209+
printArgs = true;
207210
} else if (arg.startsWith("-h") || arg.equals("--help")) {
208211
help(false);
209212
} else if (arg.startsWith("-")) {
@@ -220,6 +223,10 @@ public static Options parse(String[] args) throws IOException {
220223
if (options.sourceFiles.isEmpty()) {
221224
usage("no source files");
222225
}
226+
if (printArgs) {
227+
System.err.print("tree_shaker ");
228+
System.err.println(String.join(" ", args));
229+
}
223230

224231
return options;
225232
}

0 commit comments

Comments
 (0)