Skip to content

Commit

Permalink
Add --version flag (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
inverse authored Aug 22, 2022
1 parent 36a8a6a commit 917a15f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.4.0

- Add `--version` flag

# 0.3.1

- Validate `--status-code` is an integer
Expand Down
5 changes: 5 additions & 0 deletions cert_host_scraper/cli.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import logging
import sys
from pathlib import Path

import click
from requests import RequestException
from rich.console import Console
from rich.progress import track
from rich.table import Table
from single_source import get_version

__version__ = get_version(__name__, Path(__file__).parent.parent)

from cert_host_scraper import Options, Result, fetch_urls, validate_url

Expand All @@ -21,6 +25,7 @@ def validate_status_code(

@click.group()
@click.option("--debug", is_flag=True, help="Whether to enable debug level output")
@click.version_option(__version__, message="%(prog)s: %(version)s")
def cli(debug: bool):
log_level = logging.DEBUG if debug else logging.INFO
logging.basicConfig(level=log_level)
Expand Down
14 changes: 13 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ beautifulsoup4 = "^4.10.0"
click = "^8.0.3"
aiohttp = {extras = ["speedups"], version = "^3.8.1"}
rich = "^11.0.0"
single-source = "^0.3.0"

[tool.poetry.dev-dependencies]
pytest = "^7.1.2"
Expand Down

0 comments on commit 917a15f

Please sign in to comment.