Skip to content

Commit

Permalink
add --version command
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmehl committed Jun 14, 2024
1 parent 6144a19 commit 51c2c32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tonuino_cards_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

"""Global constants"""

from importlib.metadata import version

__version__ = version("tonuino-cards-manager")

MODES = {
"play-random": 1,
"album": 2,
Expand Down
2 changes: 2 additions & 0 deletions tonuino_cards_manager/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import argparse
import logging

from . import __version__
from ._config import parse_config
from ._qrcode import generate_qr_codes

Expand All @@ -19,6 +20,7 @@
help="The destination directory in which the data is written to",
)
parser.add_argument("-v", "--verbose", action="store_true", help="Verbose output")
parser.add_argument("--version", action="version", version="%(prog)s " + __version__)


def configure_logger(args) -> logging.Logger:
Expand Down

0 comments on commit 51c2c32

Please sign in to comment.