From d8a1376b46f15a5a2c058bccb4877011b16dfcb3 Mon Sep 17 00:00:00 2001 From: Ben Hauser Date: Wed, 29 Jul 2020 14:09:52 +0300 Subject: [PATCH] feat: add version flag --- brownie/_cli/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/brownie/_cli/__main__.py b/brownie/_cli/__main__.py index 6be08dd4e..f177a5754 100644 --- a/brownie/_cli/__main__.py +++ b/brownie/_cli/__main__.py @@ -27,6 +27,7 @@ Options: --help -h Display this message + --version Show version and exit Type 'brownie --help' for specific options and more information about each command.""" @@ -36,6 +37,9 @@ def main(): print(f"Brownie v{__version__} - Python development framework for Ethereum\n") + if "--version" in sys.argv: + sys.exit() + if len(sys.argv) < 2 or sys.argv[1].startswith("-"): # this call triggers a SystemExit docopt(__doc__, ["brownie", "-h"])