Skip to content

Commit

Permalink
Adding version output
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmet2mir committed Oct 25, 2020
1 parent 7bcc937 commit 244e98f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion wildq/_wildq_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.0.0" # managed by poetry-dynamic-versioning
__version__ = "0.0.0" # managed by poetry-dynamic-versioning
9 changes: 9 additions & 0 deletions wildq/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

# local
import wildq.filetypes
from wildq._wildq_version import __version__


class Config:
pass


# could be replaced by importlib / getattr but explicit is better than implicit
SUPPORTED_FILETYPES = {
Expand All @@ -18,6 +24,8 @@
"yaml": wildq.filetypes.yaml_type,
}

PASS_CONFIG = click.make_pass_decorator(Config, ensure=True)


def compiler(jq_filter, data):
return jq.compile(jq_filter).input(data)
Expand Down Expand Up @@ -107,6 +115,7 @@ def compiler(jq_filter, data):
)
@click.argument("jq_filter")
@click.argument("file", type=click.File("r"), default=sys.stdin)
@click.version_option(version=__version__)
def cli(*args, **kwargs):
from pprint import pprint

Expand Down

0 comments on commit 244e98f

Please sign in to comment.