From d7bbdbad759c4f932be7afbad037a4dda2891781 Mon Sep 17 00:00:00 2001 From: Koen Vervloesem Date: Fri, 22 Dec 2023 21:55:57 +0100 Subject: [PATCH] Show version in --help output --- TheengsGateway/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/TheengsGateway/config.py b/TheengsGateway/config.py index fee45b99..2c1c0ff9 100644 --- a/TheengsGateway/config.py +++ b/TheengsGateway/config.py @@ -9,6 +9,8 @@ import json from pathlib import Path +from importlib_metadata import version + # Each configuration option is added to: # - the DEFAULT_CONFIG dict with its default value # - the parse_args function for its command-line argument @@ -49,7 +51,9 @@ def parse_args() -> argparse.Namespace: """Parse command-line arguments and return them.""" - parser = argparse.ArgumentParser() + parser = argparse.ArgumentParser( + description=f"TheengsGateway {version('TheengsGateway')}", + ) parser.add_argument( "-a", "--adapter",