Skip to content

Commit a7a6df3

Browse files
committed
add version flag to cli
1 parent 9fb5ce2 commit a7a6df3

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

dbt2looker/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
import logging
44
import pathlib
55
import os
6+
try:
7+
from importlib.metadata import version
8+
except ImportError:
9+
from importlib_metadata import version
610

711
import yaml
812
try:
@@ -64,6 +68,11 @@ def get_dbt_project_config(prefix: str):
6468

6569
def run():
6670
argparser = argparse.ArgumentParser()
71+
argparser.add_argument(
72+
'--version',
73+
action='version',
74+
version=f'dbt2looker {version("dbt2looker")}',
75+
)
6776
argparser.add_argument(
6877
'--target',
6978
help='Path to dbt target directory containing manifest.json and catalog.json.',

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dbt2looker"
3-
version = "0.7.2"
3+
version = "0.7.3"
44
description = "Generate lookml view files from dbt models"
55
authors = ["oliverlaslett <[email protected]>"]
66
license = "MIT"
@@ -15,6 +15,7 @@ pydantic = "^1.8.1"
1515
PyYAML = "^5.4.1"
1616
jsonschema = "^3.2.0"
1717
typing-extensions = "^3.10.0"
18+
importlib-metadata = "^4.8.1"
1819

1920
[tool.poetry.dev-dependencies]
2021

0 commit comments

Comments
 (0)