Fix stress daemon help message

patch by Christopher Bailey; reviewed by Blake Eggleston for CASSANDRA-12563
This commit is contained in:
Chris Batey 2016-08-30 08:53:09 +01:00 committed by Jason Brown
parent 5f66d48b38
commit 3f41d7a76f
2 changed files with 18 additions and 34 deletions

View File

@ -1,4 +1,5 @@
3.0.11
* Stress daemon help is incorrect (CASSANDRA-12563)
* Remove ALTER TYPE support (CASSANDRA-12443)
* Fix assertion for certain legacy range tombstone pattern (CASSANDRA-12203)
* Set javac encoding to utf-8 (CASSANDRA-11077)

View File

@ -153,52 +153,35 @@ public class SettingsMisc implements Serializable
public static Runnable helpHelpPrinter()
{
return new Runnable()
{
@Override
public void run()
{
System.out.println("Usage: ./bin/cassandra-stress help <command|option>");
System.out.println("Commands:");
for (Command cmd : Command.values())
System.out.println(" " + cmd.names.toString().replaceAll("\\[|\\]", ""));
System.out.println("Options:");
for (CliOption op : CliOption.values())
System.out.println(" -" + op.toString().toLowerCase() + (op.extraName != null ? ", " + op.extraName : ""));
}
return () -> {
System.out.println("Usage: ./bin/cassandra-stress help <command|option>");
System.out.println("Commands:");
for (Command cmd : Command.values())
System.out.println(" " + cmd.names.toString().replaceAll("\\[|\\]", ""));
System.out.println("Options:");
for (CliOption op : CliOption.values())
System.out.println(" -" + op.toString().toLowerCase() + (op.extraName != null ? ", " + op.extraName : ""));
};
}
public static Runnable printHelpPrinter()
{
return new Runnable()
return () -> GroupedOptions.printOptions(System.out, "print", new GroupedOptions()
{
@Override
public void run()
public List<? extends Option> options()
{
GroupedOptions.printOptions(System.out, "print", new GroupedOptions()
{
@Override
public List<? extends Option> options()
{
return Arrays.asList(new OptionDistribution("dist=", null, "A mathematical distribution"));
}
});
return Arrays.asList(new OptionDistribution("dist=", null, "A mathematical distribution"));
}
};
});
}
public static Runnable sendToDaemonHelpPrinter()
{
return new Runnable()
{
@Override
public void run()
{
System.out.println("Usage: -sendToDaemon <host>");
System.out.println();
System.out.println("Specify a host running the stress server to send this stress command to");
}
return () -> {
System.out.println("Usage: -sendto <host>");
System.out.println();
System.out.println("Specify a host running the stress server to send this stress command to");
};
}
@ -212,7 +195,7 @@ public class SettingsMisc implements Serializable
if (params.length != 1)
{
sendToDaemonHelpPrinter().run();
System.out.println("Invalid -send-to specifier: " + Arrays.toString(params));
System.out.println("Invalid -sendto specifier: " + Arrays.toString(params));
System.exit(1);
}
return params[0];