burrow/src/main/java/io/rudefox/burrow/RudefoxBurrow.java

33 lines
1.1 KiB
Java

package io.rudefox.burrow;
import com.bjdweck.bitcoin.params.INetworkParameters;
import com.bjdweck.bitcoin.params.NetworkParameters;
import picocli.AutoComplete;
import picocli.CommandLine;
@CommandLine.Command(
name = "burrow",
synopsisSubcommandLabel = "COMMAND",
description = "Offline wallet tool",
subcommands = {MnemonicCommand.class, WalletCommand.class, AutoComplete.GenerateCompletion.class}
)
public class RudefoxBurrow implements Runnable {
@CommandLine.Option(names = "--testnet", description = "run on Bitcoin Testnet (default: Mainnet)")
boolean testnet = false;
public INetworkParameters getNetworkParameters() {
return testnet ? NetworkParameters.Testnet() : NetworkParameters.Mainnet();
}
public static void main(String[] args) {
new CommandLine(new RudefoxBurrow()).execute(args);
}
@CommandLine.Spec
CommandLine.Model.CommandSpec commandSpec;
public void run() {
throw new CommandLine.ParameterException(commandSpec.commandLine(), "Missing required subcommand");
}
}