forked from bisq-network/bisq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced the Scanner input read loop with upgraded joptsimple dependency. Cli now takes a single, non-option program argument, runs it and exits. Also removed the "stop client" command because there is no input loop, but shutdown() is called for orderly channel shudown before the jvm terminates. Also changed cmd syntax from camel case to lowercase, mimicking bitcoin-cli. Configured logback to supress all debug & info level netty output, and bypassed logback to print results to System.out.
- Loading branch information
Showing
5 changed files
with
86 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package bisq.cli.app; | ||
|
||
import joptsimple.OptionParser; | ||
|
||
import static java.lang.System.err; | ||
|
||
final class CommandParser { | ||
|
||
// Option name constants | ||
static final String HELP = "help"; | ||
static final String GETBALANCE = "getbalance"; | ||
static final String GETVERSION = "getversion"; | ||
static final String STOPSERVER = "stopserver"; | ||
|
||
OptionParser configure() { | ||
OptionParser parser = new OptionParser(); | ||
parser.allowsUnrecognizedOptions(); | ||
parser.nonOptions(GETBALANCE).ofType(String.class).describedAs("get btc balance"); | ||
parser.nonOptions(GETVERSION).ofType(String.class).describedAs("get bisq version"); | ||
return parser; | ||
} | ||
|
||
static void printUsage() { | ||
err.println("Usage: bisq-cli getbalance | getversion"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters