From 670a352c6e0603881c5ee0047640e39f35bc1f3f Mon Sep 17 00:00:00 2001 From: Hazel Noack Date: Wed, 11 Jun 2025 10:42:38 +0200 Subject: [PATCH] added barebone cli --- $REPO_NAME_SNAKE/__about__.py | 2 -- $REPO_NAME_SNAKE/__init__.py | 6 ++++++ $REPO_NAME_SNAKE/__main__.py | 17 +++++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) delete mode 100644 $REPO_NAME_SNAKE/__about__.py diff --git a/$REPO_NAME_SNAKE/__about__.py b/$REPO_NAME_SNAKE/__about__.py deleted file mode 100644 index d4b6dbc..0000000 --- a/$REPO_NAME_SNAKE/__about__.py +++ /dev/null @@ -1,2 +0,0 @@ -__version__ = "0.0.0" -__name__ = "$REPO_NAME_SNAKE" \ No newline at end of file diff --git a/$REPO_NAME_SNAKE/__init__.py b/$REPO_NAME_SNAKE/__init__.py index e69de29..8ac352a 100644 --- a/$REPO_NAME_SNAKE/__init__.py +++ b/$REPO_NAME_SNAKE/__init__.py @@ -0,0 +1,6 @@ +import pathlib + + +__name__ = "$REPO_NAME_SNAKE" +__folder__ = str(pathlib.Path(__file__).parent) + diff --git a/$REPO_NAME_SNAKE/__main__.py b/$REPO_NAME_SNAKE/__main__.py index 453d429..ac96798 100644 --- a/$REPO_NAME_SNAKE/__main__.py +++ b/$REPO_NAME_SNAKE/__main__.py @@ -1,5 +1,18 @@ -from .__about__ import __name__, __version__ +import argparse +import logging def cli(): - print(f"Running {__name__} version {__version__} from __main__.py") + parser = argparse.ArgumentParser( + description="$REPO_DESCRIPTION", + formatter_class=argparse.RawTextHelpFormatter + ) + + parser.add_argument( + "--debug", + action="store_true", + help="Sets the logging level to debug." + ) + + args = parser.parse_args() +