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 {
@Option(
names = "--from",
names = "--to",
required = true,
paramLabel = MANDATORY_FILE_FORMAT_HELP,
description = "File to write public key to",

@ -40,11 +40,11 @@ public class PublicKeySubCommandTest extends CommandTestAbstract {
+ System.lineSeparator();
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()
+ "This command exports the node public key to a file."
+ System.lineSeparator()
+ " --from=<FILE> File to write public key to"
+ " --to=<FILE> File to write public key to"
+ System.lineSeparator()
+ " -h, --help Show this help message and exit."
+ System.lineSeparator()
@ -83,7 +83,7 @@ public class PublicKeySubCommandTest extends CommandTestAbstract {
@Test
public void callingPublicKeyExportSubCommandWithoutPathMustDisplayErrorAndUsage() {
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);
}
@ -105,7 +105,7 @@ public class PublicKeySubCommandTest extends CommandTestAbstract {
final File file = File.createTempFile("public", "key");
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))
.startsWith(keyPair.getPublicKey().toString())

Loading…
Cancel
Save