[bisq-network/bisq] Remove read stdin loop (#4097)

Stan notifications at github.com
Mon Mar 30 14:42:11 UTC 2020


@ghubstan commented on this pull request.



> +    // 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");

Prints usage message to stdout, and uses EXIT_SUCCESS and EXIT_FAILURE arguments in System.exit(). 

What's not done:  help formatting.  I need to discuss Bisq + `joptsimple.HelpFormatter` issues with @cbeams.  Right now, the only options passed to Cli are of type `NonOptionArgumentSpec`, which did not work as expected with `joptsimple.HelpFormatter`.  It looks like Bisq Config only uses `ArgumentAcceptingOptionSpec` options, which do work with `joptsimple.HelpFormatter`.  It did not seem correct to change non-option cli arguments to argument accepting options just to make them work with the `joptsimple.HelpFormatter` interface, which is why I checked in the 


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4097#discussion_r400246596
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200330/730bb65d/attachment.html>


More information about the bisq-github mailing list