-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use posix-style CLI opts, provide method help #5081
Conversation
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.)
There is no need for a switch here, the doc exists or it does not.
There was a problem hiding this 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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line break needed
There was a problem hiding this comment.
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.
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 tobisq-cli
commands.Adjust CLI to new posix-style opts, and method help service.
Delete uneeded
NegativeNumberOptions
class becausejoptsimple
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.