Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
kdziedzic68 committed Dec 5, 2024
1 parent 10df242 commit 75abda6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/ragbits-cli/src/ragbits/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import importlib.util
import pkgutil
from pathlib import Path
from typing import Annotated

import typer

Expand All @@ -13,8 +14,12 @@

@app.callback()
def output_type(
output: OutputType = typer.Option("text", "--output", "-o", help="Set the output type (text or json)"), # noqa: B008
output: Annotated[
OutputType, typer.Option("--output", "-o", help="Set the output type (text or json)")
] = OutputType.text.value, # type: ignore
) -> None:
# type ignore is a workaround for typer issue
# enforcing to use str as default value
"""Sets an output type for the CLI
Args:
output: type of output to be set
Expand Down

0 comments on commit 75abda6

Please sign in to comment.