fixed key export subcommand option was --from instead of --to (#711)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Nicolas MASSART 6 years ago committed by GitHub
parent 8586357036
commit 1489fa5543
  1. 2
      pantheon/src/main/java/tech/pegasys/pantheon/cli/PublicKeySubCommand.java
  2. 8
      pantheon/src/test/java/tech/pegasys/pantheon/cli/PublicKeySubCommandTest.java

@ -82,7 +82,7 @@ class PublicKeySubCommand implements Runnable {
static class ExportSubCommand implements Runnable { static class ExportSubCommand implements Runnable {
@Option( @Option(
names = "--from", names = "--to",
required = true, required = true,
paramLabel = MANDATORY_FILE_FORMAT_HELP, paramLabel = MANDATORY_FILE_FORMAT_HELP,
description = "File to write public key to", description = "File to write public key to",

@ -40,11 +40,11 @@ public class PublicKeySubCommandTest extends CommandTestAbstract {
+ System.lineSeparator(); + System.lineSeparator();
private static final String EXPECTED_PUBLIC_KEY_EXPORT_USAGE = private static final String EXPECTED_PUBLIC_KEY_EXPORT_USAGE =
"Usage: pantheon public-key export [-hV] --from=<FILE>" "Usage: pantheon public-key export [-hV] --to=<FILE>"
+ System.lineSeparator() + System.lineSeparator()
+ "This command exports the node public key to a file." + "This command exports the node public key to a file."
+ System.lineSeparator() + System.lineSeparator()
+ " --from=<FILE> File to write public key to" + " --to=<FILE> File to write public key to"
+ System.lineSeparator() + System.lineSeparator()
+ " -h, --help Show this help message and exit." + " -h, --help Show this help message and exit."
+ System.lineSeparator() + System.lineSeparator()
@ -83,7 +83,7 @@ public class PublicKeySubCommandTest extends CommandTestAbstract {
@Test @Test
public void callingPublicKeyExportSubCommandWithoutPathMustDisplayErrorAndUsage() { public void callingPublicKeyExportSubCommandWithoutPathMustDisplayErrorAndUsage() {
parseCommand(PUBLIC_KEY_SUBCOMMAND_NAME, PUBLIC_KEY_EXPORT_SUBCOMMAND_NAME); parseCommand(PUBLIC_KEY_SUBCOMMAND_NAME, PUBLIC_KEY_EXPORT_SUBCOMMAND_NAME);
final String expectedErrorOutputStart = "Missing required option '--from=<FILE>'"; final String expectedErrorOutputStart = "Missing required option '--to=<FILE>'";
assertThat(commandErrorOutput.toString()).startsWith(expectedErrorOutputStart); assertThat(commandErrorOutput.toString()).startsWith(expectedErrorOutputStart);
} }
@ -105,7 +105,7 @@ public class PublicKeySubCommandTest extends CommandTestAbstract {
final File file = File.createTempFile("public", "key"); final File file = File.createTempFile("public", "key");
parseCommand( parseCommand(
PUBLIC_KEY_SUBCOMMAND_NAME, PUBLIC_KEY_EXPORT_SUBCOMMAND_NAME, "--from", file.getPath()); PUBLIC_KEY_SUBCOMMAND_NAME, PUBLIC_KEY_EXPORT_SUBCOMMAND_NAME, "--to", file.getPath());
assertThat(contentOf(file)) assertThat(contentOf(file))
.startsWith(keyPair.getPublicKey().toString()) .startsWith(keyPair.getPublicKey().toString())

Loading…
Cancel
Save