Skip to content

Commit

Permalink
Added ability to print version info
Browse files Browse the repository at this point in the history
  • Loading branch information
pchakraborty committed Aug 12, 2024
1 parent 0da5ef4 commit ae4d5a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mepo/cmdline/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
from ..utilities import mepoconfig


def get_version():
from importlib import metadata

return metadata.version("mepo")


class MepoArgParser:

__slots__ = ["parser", "subparsers"]
Expand All @@ -16,6 +22,7 @@ def __init__(self):
self.parser = argparse.ArgumentParser(
description="Tool to manage (m)ultiple r(epo)s"
)
self.parser.add_argument("--version", action="version", version=get_version())
self.subparsers = self.parser.add_subparsers()
self.subparsers.title = "mepo commands"
self.subparsers.required = True
Expand Down

0 comments on commit ae4d5a0

Please sign in to comment.