Switch to using a varargs syntax in CommandRunner.
Summary:
We use the array syntax for the final argument for CommandRunner.runCommand.
If we use the varargs syntax, calling the method becomes cleaner.
Test Plan: buck test --all
diff --git a/src/com/facebook/buck/cli/AbstractCommandRunner.java b/src/com/facebook/buck/cli/AbstractCommandRunner.java
index 413d8a0..875979c 100644
--- a/src/com/facebook/buck/cli/AbstractCommandRunner.java
+++ b/src/com/facebook/buck/cli/AbstractCommandRunner.java
@@ -77,7 +77,7 @@
}
@Override
- public final int runCommand(BuckConfig buckConfig, String[] args) throws IOException {
+ public final int runCommand(BuckConfig buckConfig, String... args) throws IOException {
ParserAndOptions<T> parserAndOptions = createParser(buckConfig);
T options = parserAndOptions.options;
CmdLineParser parser = parserAndOptions.parser;
diff --git a/src/com/facebook/buck/cli/AuditCommandRunner.java b/src/com/facebook/buck/cli/AuditCommandRunner.java
index 065c69f..c92dadb 100644
--- a/src/com/facebook/buck/cli/AuditCommandRunner.java
+++ b/src/com/facebook/buck/cli/AuditCommandRunner.java
@@ -33,7 +33,7 @@
}
@Override
- public int runCommand(BuckConfig buckConfig, String[] args) throws IOException {
+ public int runCommand(BuckConfig buckConfig, String... args) throws IOException {
if (args.length == 0) {
console.printBuildFailure("No audit command is given.");
printUsage();
diff --git a/src/com/facebook/buck/cli/CommandRunner.java b/src/com/facebook/buck/cli/CommandRunner.java
index 181768f..126f7fa 100644
--- a/src/com/facebook/buck/cli/CommandRunner.java
+++ b/src/com/facebook/buck/cli/CommandRunner.java
@@ -24,6 +24,6 @@
* @param args the arguments passed to the command, not including the command name
* @return the appropriate exit code for the command
*/
- public int runCommand(BuckConfig buckConfig, String[] args) throws IOException;
+ public int runCommand(BuckConfig buckConfig, String... args) throws IOException;
}