diff --git a/setup.py b/setup.py index dc0b1fb8..dae5e86b 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ from pathlib import Path from setuptools import setup, find_packages - -__version__ = "0.1.1" +from spectacles import __version__ here = Path(__file__).parent.resolve() diff --git a/spectacles/__init__.py b/spectacles/__init__.py index e69de29b..485f44ac 100644 --- a/spectacles/__init__.py +++ b/spectacles/__init__.py @@ -0,0 +1 @@ +__version__ = "0.1.1" diff --git a/spectacles/cli.py b/spectacles/cli.py index 95d5e1f7..6f7fb37b 100644 --- a/spectacles/cli.py +++ b/spectacles/cli.py @@ -6,6 +6,7 @@ import logging import os from typing import Callable +from spectacles import __version__ from spectacles.runner import Runner from spectacles.client import LookerClient from spectacles.exceptions import SpectaclesException, ValidationError @@ -223,6 +224,7 @@ def create_parser() -> argparse.ArgumentParser: """ parser = argparse.ArgumentParser(prog="spectacles") + parser.add_argument("--version", action="version", version=__version__) subparser_action = parser.add_subparsers( title="Available sub-commands", dest="command" )