mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-14 19:25:51 +00:00
Add help text to BuildCheckpoints.
This commit is contained in:
parent
0e7819d1bf
commit
e978ff4997
@ -26,6 +26,7 @@ import org.bitcoinj.store.MemoryBlockStore;
|
||||
import org.bitcoinj.utils.BriefLogFormatter;
|
||||
import org.bitcoinj.utils.Threading;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.io.Resources;
|
||||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
import joptsimple.OptionSpec;
|
||||
@ -55,10 +56,16 @@ public class BuildCheckpoints {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
OptionParser parser = new OptionParser();
|
||||
parser.accepts("help");
|
||||
OptionSpec<NetworkEnum> netFlag = parser.accepts("net").withRequiredArg().ofType(NetworkEnum.class).defaultsTo(NetworkEnum.MAIN);
|
||||
OptionSpec<Integer> daysFlag = parser.accepts("days").withRequiredArg().ofType(Integer.class).defaultsTo(30);
|
||||
OptionSet options = parser.parse(args);
|
||||
|
||||
if (options.has("help")) {
|
||||
System.out.println(Resources.toString(BuildCheckpoints.class.getResource("build-checkpoints-help.txt"), Charsets.UTF_8));
|
||||
return;
|
||||
}
|
||||
|
||||
String suffix;
|
||||
switch (netFlag.value(options)) {
|
||||
case MAIN:
|
||||
|
@ -226,11 +226,9 @@ public class WalletTool {
|
||||
parser.accepts("dump-privkeys");
|
||||
options = parser.parse(args);
|
||||
|
||||
final String HELP_TEXT = Resources.toString(WalletTool.class.getResource("wallet-tool-help.txt"), Charsets.UTF_8);
|
||||
|
||||
if (args.length == 0 || options.has("help") ||
|
||||
options.nonOptionArguments().size() < 1 || options.nonOptionArguments().contains("help")) {
|
||||
System.out.println(HELP_TEXT);
|
||||
System.out.println(Resources.toString(WalletTool.class.getResource("wallet-tool-help.txt"), Charsets.UTF_8));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
BuildCheckpoints: create checkpoint files to use with CheckpointManager
|
||||
|
||||
Usage: build-checkpoints --flags
|
||||
|
||||
>>> OPTIONS
|
||||
--net=XXX Which network to connect to, defaults to MAIN, can also be TEST or REGTEST.
|
||||
--days=<int> How many days to keep as a safety margin. Checkpointing will be done up to this many days ago.
|
Loading…
x
Reference in New Issue
Block a user