From 2acee46b7ea3a9e391466c0c72e5bcd0530f932f Mon Sep 17 00:00:00 2001 From: ChanceNCounter Date: Wed, 20 Jan 2021 19:34:02 -0800 Subject: [PATCH] Bump version, add --version --- bak/__init__.py | 1 + bak/__main__.py | 8 ++++++-- setup.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bak/__init__.py b/bak/__init__.py index e69de29..8343868 100644 --- a/bak/__init__.py +++ b/bak/__init__.py @@ -0,0 +1 @@ +version = "0.0.1a1" \ No newline at end of file diff --git a/bak/__main__.py b/bak/__main__.py index 03d5e99..00d4024 100644 --- a/bak/__main__.py +++ b/bak/__main__.py @@ -6,6 +6,7 @@ from click_default_group import DefaultGroup from bak import commands +from bak import version as bak_version def __print_help(): @@ -23,10 +24,13 @@ def bak(): @bak.command("\0", hidden=True) +@click.option("--version", required=False, is_flag=True) @click.argument("filename", required=False, type=click.Path(exists=True)) # Ensures that 'bak --help' is printed if it doesn't get a filename -def create(filename): - if not filename: +def create(filename, version): + if version: + click.echo(f"bak version {bak_version}") + elif not filename: __print_help() else: commands.create_bakfile(filename) diff --git a/setup.py b/setup.py index 79a73bb..a377269 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ 'rich==9.1.0'] setup(name='bak', - version='0.0.1a', + version='0.0.1a1', description='the .bak manager', author='ChanceNCounter', author_email='ChanceNCounter@icloud.com',