Skip to content

Commit

Permalink
Add: バージョン情報を出力する --version オプションを追加 (Close #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Aug 13, 2024
1 parent d7abe34 commit cc1ad05
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions isdb_scanner/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
from isdb_scanner.tuner import TunerTuningError


def version(value: bool):
if value is True:
typer.echo(f'ISDBScanner version {__version__}')
raise typer.Exit()

app = typer.Typer()

@app.command(help='ISDBScanner: Scans Japanese TV broadcast channels (ISDB-T/ISDB-S) and outputs results in various formats (depends on recisdb)')
Expand All @@ -37,6 +42,7 @@ def main(
exclude_pay_tv: bool = typer.Option(False, help='Exclude pay-TV channels from scan results and include only free-to-air terrestrial and BS channels.'),
output_recisdb_log: bool = typer.Option(False, help='Output recisdb log to stderr.'),
list_tuners: bool = typer.Option(False, help='List available ISDB-T/ISDB-S tuners and exit.'),
version: bool = typer.Option(None, '--version', callback=version, is_eager=True, help='Show version information.'),
):

print(Rule(
Expand Down

0 comments on commit cc1ad05

Please sign in to comment.