From 7efece0224959dd6db25ca09df03130108aaa445 Mon Sep 17 00:00:00 2001 From: drevicko Date: Fri, 7 Apr 2017 10:04:51 +0100 Subject: [PATCH] add option to show senpy version number --- senpy/__main__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/senpy/__main__.py b/senpy/__main__.py index dd711e4..9913ed2 100644 --- a/senpy/__main__.py +++ b/senpy/__main__.py @@ -77,7 +77,16 @@ def main(): action='store_true', default=False, help='Do not run a server, only install plugin dependencies') + parser.add_argument( + '--version', + '-v', + action='store_true', + default=False, + help='Output the senpy version and exit') args = parser.parse_args() + if args.version: + print('Senpy version {}'.format(senpy.__version__)) + exit(1) logging.basicConfig() rl = logging.getLogger() rl.setLevel(getattr(logging, args.level))