added version flag and its output

This commit is contained in:
2025-09-27 15:29:34 +02:00
parent 9c4135cb3c
commit 518ca3d815
2 changed files with 4 additions and 1 deletions

View File

@@ -9,5 +9,6 @@ again.
## Changelog ## Changelog
<2025-09-27> - Beta b0.1.1 - added the version output<br>
<2025-09-27> - Beta b0.1.1 - fixed verbosity switch for subprocess<br> <2025-09-27> - Beta b0.1.1 - fixed verbosity switch for subprocess<br>
<2025-09-27> - *Beta b0.0.1* - first release of tempbox <2025-09-27> - *Beta b0.0.1* - first release of tempbox

View File

@@ -3,7 +3,7 @@ import argparse
from tempbox_functions import execute_as_subprocess from tempbox_functions import execute_as_subprocess
tempbox_version = "Tempbox Beta b0.1.1"
# Argument parsing # Argument parsing
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
prog="Tempbox", prog="Tempbox",
@@ -25,6 +25,8 @@ parser.add_argument(
help="Takes the string right after the flag to execute it.", help="Takes the string right after the flag to execute it.",
) )
parser.add_argument("-V", "--version", action="version", version=tempbox_version)
args = parser.parse_args() args = parser.parse_args()
if args.command is not None: if args.command is not None: