From 5b20288d06a86e6a5e17eb2a6b0fc74d7a39cb33 Mon Sep 17 00:00:00 2001 From: Patrick Robertson Date: Fri, 17 Jan 2025 16:59:57 +0100 Subject: [PATCH] Add a 'version' arg to get the current running version --- src/auto_archiver/core/config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/auto_archiver/core/config.py b/src/auto_archiver/core/config.py index 9bce88f..380319c 100644 --- a/src/auto_archiver/core/config.py +++ b/src/auto_archiver/core/config.py @@ -1,6 +1,6 @@ - - -import argparse, yaml +import importlib +import argparse +import yaml from dataclasses import dataclass, field from typing import List from collections import defaultdict @@ -54,6 +54,7 @@ class Config: ) parser.add_argument('--config', action='store', dest='config', help='the filename of the YAML configuration file (defaults to \'config.yaml\')', default='orchestration.yaml') + parser.add_argument('--version', action='version', version=importlib.metadata.version('auto_archiver')) for configurable in self.configurable_parents: child: Step