Skip to content
Snippets Groups Projects
Commit 6188d89c authored by mjbonifa's avatar mjbonifa
Browse files

added version automatically based on pyproject.toml, called acmc --version

parent d35aa813
No related branches found
No related tags found
No related merge requests found
try:
from importlib.metadata import version
except ImportError: # Python <3.8
from pkg_resources import get_distribution as version
__version__ = version("acmc")
......@@ -2,6 +2,7 @@ import argparse
import logging
from pathlib import Path
import acmc
from acmc import trud, omop, phen, logging_config as lc
# setup logging
......@@ -60,9 +61,9 @@ def phen_diff(args):
args.phen_dir_old)
def main():
logger.info("ACMC Tool")
parser = argparse.ArgumentParser(description="ACMC command-line tool")
parser.add_argument("--debug", action="store_true", help="Enable debug mode")
parser.add_argument("--version", action="version", version=f"acmc {acmc.__version__}")
# Top-level commands
subparsers = parser.add_subparsers(dest="command", required=True, help="Available commands")
......@@ -158,6 +159,7 @@ def main():
lc.set_log_level(logging.DEBUG)
# Call the function associated with the command
logger.info("ACMC Tool")
args.func(args)
if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment