Skip to content

Commit

Permalink
fix typing for callback
Browse files Browse the repository at this point in the history
  • Loading branch information
kdziedzic68 committed Dec 5, 2024
1 parent 4df2786 commit 13bbbe3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/ragbits-cli/src/ragbits/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@

@app.callback()
def output_type(
# `OutputType.text.value` used as a workaround for the issue with `typer.Option` not accepting Enum values
output: Annotated[
OutputType, typer.Option("--output", "-o", help="Set the output type (text or json)")
] = OutputType.text.value, # type: ignore
OutputType | None, typer.Option("--output", "-o", help="Set the output type (text or json)")
] = None,
) -> None:
"""Sets an output type for the CLI
Args:
output: type of output to be set
"""
if not output:
return
app.set_output_type(output_type=output)


Expand Down

0 comments on commit 13bbbe3

Please sign in to comment.