diff --git a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PublicKeySubCommand.java b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PublicKeySubCommand.java index 0d1ab57161..1638b73946 100644 --- a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PublicKeySubCommand.java +++ b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PublicKeySubCommand.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", diff --git a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PublicKeySubCommandTest.java b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PublicKeySubCommandTest.java index 1a8b9e3b3b..fe2d49d6a6 100644 --- a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PublicKeySubCommandTest.java +++ b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PublicKeySubCommandTest.java @@ -40,15 +40,15 @@ public class PublicKeySubCommandTest extends CommandTestAbstract { + System.lineSeparator(); private static final String EXPECTED_PUBLIC_KEY_EXPORT_USAGE = - "Usage: pantheon public-key export [-hV] --from=" + "Usage: pantheon public-key export [-hV] --to=" + System.lineSeparator() + "This command exports the node public key to a file." + System.lineSeparator() - + " --from= File to write public key to" + + " --to= File to write public key to" + System.lineSeparator() - + " -h, --help Show this help message and exit." + + " -h, --help Show this help message and exit." + System.lineSeparator() - + " -V, --version Print version information and exit." + + " -V, --version Print version information and exit." + System.lineSeparator(); private static final String PUBLIC_KEY_SUBCOMMAND_NAME = "public-key"; @@ -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='"; + final String expectedErrorOutputStart = "Missing required option '--to='"; 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())