Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-3067] update the "pantheon blocks export" command usage #1887

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private <T> void importRlpBlocks(final PantheonController<T> controller, final P
*/
@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")
Expand All @@ -228,16 +228,15 @@ static class ExportSubCommand 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;

@Option(
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;

Expand All @@ -253,7 +252,7 @@ static class ExportSubCommand 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -223,7 +223,7 @@ public void blocksExport_noDbDirectory() throws IOException {
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);
Expand All @@ -244,7 +244,7 @@ public void blocksExport_emptyDbDirectory() throws IOException {
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);
Expand Down