diff --git a/cli_docs/conf.py b/cli_docs/conf.py index 3ac2dc4..a343df1 100644 --- a/cli_docs/conf.py +++ b/cli_docs/conf.py @@ -18,9 +18,9 @@ copyright = '2021 Soren Bjornstad' author = 'Soren Bjornstad' # The short X.Y version -version = "0.1.4" +version = "0.1.5" # The full version, including alpha/beta/rc tags -release = "0.1.4" +release = "0.1.5" # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index 24ae568..898d527 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ with open("README.md", "r") as fh: setuptools.setup( name="tzk", - version="0.1.4", + version="0.1.5", author="Soren I. Bjornstad", author_email="zettelkasten@sorenbjornstad.com", description="Build tool for TiddlyWiki Zettelkasten", diff --git a/tzk/__main__.py b/tzk/__main__.py index 2f7b167..099a8b2 100644 --- a/tzk/__main__.py +++ b/tzk/__main__.py @@ -13,6 +13,8 @@ from tzk import tw from tzk.util import (BuildError, fail, numerize, require_dependencies, pushd, TZK_VERSION) +VERSION_INFO = f"tzk version {TZK_VERSION}" + class CliCommand(ABC): """ @@ -180,7 +182,7 @@ class VersionCommand(CliCommand): pass def execute(self, args: argparse.Namespace) -> None: - print(f"tzk version {TZK_VERSION}") + print(VERSION_INFO) class BuildCommand(CliCommand): @@ -407,6 +409,12 @@ def launch(): epilog="For full documentation, see https://tzk.readthedocs.io/en/latest/.", formatter_class=argparse.RawDescriptionHelpFormatter ) + parser.add_argument( + "--version", + action="version", + version=VERSION_INFO, + help=VersionCommand.help + ) subparsers = parser.add_subparsers() for command in sorted(CliCommand.__subclasses__(), key=lambda i: i.__name__): diff --git a/tzk/util.py b/tzk/util.py index d30792a..6dcbcea 100644 --- a/tzk/util.py +++ b/tzk/util.py @@ -10,7 +10,7 @@ import sys from typing import Any, Callable, Dict, NoReturn -TZK_VERSION = "0.1.4" +TZK_VERSION = "0.1.5" class BuildError(Exception):