Update the "pantheon blocks export" command usage (#1887)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Karim T 5 years ago committed by Adrian Sutton
parent 9e6762635e
commit cddf13bece
  1. 9
      pantheon/src/main/java/tech/pegasys/pantheon/cli/subcommands/blocks/BlocksSubCommand.java
  2. 18
      pantheon/src/test/java/tech/pegasys/pantheon/cli/subcommands/blocks/BlocksSubCommandTest.java

@ -218,7 +218,7 @@ public class BlocksSubCommand implements Runnable {
*/
@Command(
name = "export",
description = "This command export a specific block from storage",
description = "This command exports a specific block, or list of blocks from storage.",
mixinStandardHelpOptions = true)
static class ExportSubCommand implements Runnable {
@SuppressWarnings("unused")
@ -228,7 +228,7 @@ public class BlocksSubCommand implements Runnable {
@Option(
names = "--start-block",
paramLabel = MANDATORY_LONG_FORMAT_HELP,
description = "the starting index of the block list to export (inclusive)",
description = "The starting index of the block, or block list to export.",
arity = "1..1")
private final Long startBlock = null;
@ -236,8 +236,7 @@ public class BlocksSubCommand implements Runnable {
names = "--end-block",
paramLabel = MANDATORY_LONG_FORMAT_HELP,
description =
"the ending index of the block list to export (exclusive), "
+ "if not specified a single block will be export",
"The ending index of the block list to export (exclusive). If not specified a single block will be exported.",
arity = "1..1")
private final Long endBlock = null;
@ -253,7 +252,7 @@ public class BlocksSubCommand implements Runnable {
names = "--to",
required = true,
paramLabel = MANDATORY_FILE_FORMAT_HELP,
description = "File to write the block list instead of standard output",
description = "File to write the block list to.",
arity = "1..1")
private File blocksExportFile = null;

@ -76,19 +76,19 @@ public class BlocksSubCommandTest extends CommandTestAbstract {
+ System.lineSeparator()
+ " --to=<FILE>"
+ System.lineSeparator()
+ "This command export a specific block from storage"
+ "This command exports a specific block, or list of blocks from storage."
+ System.lineSeparator()
+ " --end-block=<LONG> the ending index of the block list to export"
+ " --end-block=<LONG> The ending index of the block list to export"
+ System.lineSeparator()
+ " (exclusive), if not specified a single block will be"
+ " (exclusive). If not specified a single block will be"
+ System.lineSeparator()
+ " export"
+ " exported."
+ System.lineSeparator()
+ " --start-block=<LONG> the starting index of the block list to export"
+ " --start-block=<LONG> The starting index of the block, or block list to"
+ System.lineSeparator()
+ " (inclusive)"
+ " export."
+ System.lineSeparator()
+ " --to=<FILE> File to write the block list instead of standard output"
+ " --to=<FILE> File to write the block list to."
+ System.lineSeparator()
+ " -h, --help Show this help message and exit."
+ System.lineSeparator()
@ -223,7 +223,7 @@ public class BlocksSubCommandTest extends CommandTestAbstract {
final String expectedErrorOutputStart =
"Chain is empty. Unable to export blocks from specified data directory: "
+ folder.getRoot().getAbsolutePath()
+ "/"
+ File.separator
+ PantheonController.DATABASE_PATH;
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).startsWith(expectedErrorOutputStart);
@ -244,7 +244,7 @@ public class BlocksSubCommandTest extends CommandTestAbstract {
final String expectedErrorOutputStart =
"Chain is empty. Unable to export blocks from specified data directory: "
+ folder.getRoot().getAbsolutePath()
+ "/"
+ File.separator
+ PantheonController.DATABASE_PATH;
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).startsWith(expectedErrorOutputStart);

Loading…
Cancel
Save