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

oceand runs without complaining with invalid options #261

Closed
lawlawlaw opened this issue Nov 25, 2019 · 4 comments
Closed

oceand runs without complaining with invalid options #261

lawlawlaw opened this issue Nov 25, 2019 · 4 comments
Assignees
Labels

Comments

@lawlawlaw
Copy link

lawlawlaw commented Nov 25, 2019

If oceand is started with an invalid e.g. misspelled option, it will carry on without complaining. This can result in errors creeping into config files due to spelling mistakes etc.

I propose to upgrade the current option parsing system to stop with an appropriate error message if any option in the option map is not present in a predetermined list of valid options.

@nkostoulas
Copy link

Might be worth checking upstream elements/bitcoin. They have changed the whole argument system.

@86667
Copy link

86667 commented Nov 26, 2019

Bitcoin/Elements now store all possible arguments in an Arg struct, along with arguments provided by the user so checking for correct input is easy. It is a big change though and would take some time, but may be worth doing bitcoin/bitcoin#9243.

Other hacky options are:

  • generate the helpMessage strings, parse into a list of all arguments and check inputs against it
  • store a seperate list of argument strings to check against

@nkostoulas
Copy link

nkostoulas commented Nov 26, 2019

Yeah big change and a bit fiddly. I've added this to the list of upstream changes we should consider (https://github.com/commerceblock/ocean/milestone/4) #240 already. Not sure if it's worth doing at the moment but if we do this we do it proper.

@86667
Copy link

86667 commented Nov 26, 2019

Yup, I'll start looking into it now and get an idea of how big the job is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants