Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use posix-style CLI opts, provide method help #5081

Merged
merged 10 commits into from Jan 16, 2021

Conversation

ghubstan
Copy link
Member

Posix-style method opts replace the formerly ambiguous, positional method params in the CLI.

This change also adds new api CoreHelpService, for serving method specific help from the server. (Help text is defined on the server to avoid duplicating it when the api starts serving RESTful clients.)

  • Add CoreHelpService to serve method help in man page format.

  • Add some method help docs (man pages) to core's resources: createoffer, takeoffer, and several no-arg methods.

  • Add gRPC CoreHelpService stubs to CLI.

  • Move CLI method enum to its own class to help reduce file-size of growing CliMain class.

  • Add CLI method specific posix-style option parsers. Opts are parsed by the joptsimple lib, adding much needed client side validation to bisq-cli commands.

  • Adjust CLI to new posix-style opts, and method help service.

  • Delete uneeded NegativeNumberOptions class because joptsimple correctly handles negative posix style opt values (joptsimple was treating negative param values as opt labels).

  • Adjust bats mainnet smoke test to new posix-style CLI opts.

Adds all the gRPC server boilerplate, and a simple help service
that serves method help in man page format.  Help text is maintained
in text files located in core/src/main/resources/help.

Only some of the method help text files are defined in this
change, more to be added.
This helps reduce size of growing CLI class file.
Not needed anymore, and all method opts are posix style.
(The opts parsing lib used to treat negative numbers as opt labels.)
@ghubstan ghubstan added this to In progress in Ship Bisq Daemon and API Jan 14, 2021
@ripcurlx ripcurlx added this to the v1.5.5 milestone Jan 14, 2021
There is no need for a switch here, the doc exists or it does not.
Copy link
Member

@sqrrm sqrrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@@ -72,14 +73,15 @@
@Inject
public CoreApi(Config config,
CoreDisputeAgentsService coreDisputeAgentsService,
CoreOffersService coreOffersService,
CoreHelpService coreHelpService, CoreOffersService coreOffersService,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line break needed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix (5538914) will go into the next PR.

@sqrrm sqrrm merged commit 44cbea8 into bisq-network:master Jan 16, 2021
Ship Bisq Daemon and API automation moved this from In progress to Done Jan 16, 2021
@ghubstan ghubstan deleted the 04-posix-cli-opts+method-help branch January 16, 2021 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants