Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fix CLI return code on --help for ethkey, ethstore & whisper #8863

Merged
merged 1 commit into from
Jun 11, 2018

Conversation

gnunicorn
Copy link
Contributor

Docopt handles --help automatically for us, however we've handled those
Errors the same as all others: by exiting with Return Code 1, which is wrong
for a totally appropriate a quit on --help. Fortunately docopt:Error
provides an exit helper function that discriminates properly between fatal
and non-fatal errors and exist appropriately.

This patch makes sure we use that handy function in case we encounter such an
error in the CLI of ethkey, ethstore and whisper. Thus those are now giving
the appropriate Return code on --help.

fixes #8851

Docopt handles `--help` automatically for us, however we've handled those
Errors the same as all others: by exiting with Return Code `1`, which is wrong
for a totally appropriate a quit on `--help`. Fortunately `docopt:Error`
provides an `exit` helper function that discriminates properly between fatal
and non-fatal errors and exist appropriately.

This patch makes sure we use that handy function in case we encounter such an
error in the CLI of ethkey, ethstore and whisper. Thus those are now giving
the appropriate Return code on `--help`.

fixes openethereum#8851
@parity-cla-bot
Copy link

It looks like @gnunicorn signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@5chdn 5chdn added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jun 11, 2018
@5chdn 5chdn added this to the 1.12 milestone Jun 11, 2018
Copy link
Collaborator

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

lgtm

@niklasad1 niklasad1 merged commit 861d829 into openethereum:master Jun 11, 2018
@5chdn 5chdn added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 12, 2018
dvdplm added a commit that referenced this pull request Jun 12, 2018
* master:
  Tx permission contract improvement (#8400)
  Limit the number of transactions in pending set (#8777)
  Use sealing.enabled to emit eth_mining information (#8844)
  Don't allocate in expect_valid_rlp unless necessary (#8867)
  Fix Cli Return Code on --help for ethkey, ethstore & whisper (#8863)
tavakyan referenced this pull request in C4Coin/c4coin-parity Jun 14, 2018
Docopt handles `--help` automatically for us, however we've handled those
Errors the same as all others: by exiting with Return Code `1`, which is wrong
for a totally appropriate a quit on `--help`. Fortunately `docopt:Error`
provides an `exit` helper function that discriminates properly between fatal
and non-fatal errors and exist appropriately.

This patch makes sure we use that handy function in case we encounter such an
error in the CLI of ethkey, ethstore and whisper. Thus those are now giving
the appropriate Return code on `--help`.

fixes #8851
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--help option returns 1, not 0
6 participants