diff --git a/gptcli/__init__.py b/gptcli/__init__.py index e69de29..ae73625 100644 --- a/gptcli/__init__.py +++ b/gptcli/__init__.py @@ -0,0 +1 @@ +__version__ = "0.1.3" diff --git a/gptcli/gpt.py b/gptcli/gpt.py index d0253ff..e9634e9 100755 --- a/gptcli/gpt.py +++ b/gptcli/gpt.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import sys + MIN_PYTHON = (3, 9) if sys.version_info < MIN_PYTHON: sys.exit("Python %s.%s or later is required.\n" % MIN_PYTHON) @@ -130,6 +131,13 @@ def parse_args(config: GptCliConfig): help="Disable price logging.", default=config.show_price, ) + parser.add_argument( + "--version", + "-v", + action="version", + version=f"gpt-cli v{gptcli.__version__}", + help="Print the version number and exit.", + ) return parser.parse_args()