Skip to content

Commit

Permalink
fix(client): Fixed config use output error.
Browse files Browse the repository at this point in the history
Should close #2.
No more pretty error tracebacks, they are harder to read than actual
tracebacks.
  • Loading branch information
acederberg committed Sep 5, 2024
1 parent 5135dad commit 4bf2acb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/legere/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,12 @@ def use(
config.use.profile = profile

if config_path_out is None:
context.console_handler.handle(data=config.model_dump_minimal())
context.console_handler.handle(
handler_data=HandlerData(
data=config.model_dump_minimal(),
output_config=context.config.output,
)
)
raise typer.Exit(0)

context.console_handler.console.print("[green]Updating client config.")
Expand Down
6 changes: 5 additions & 1 deletion src/legere/requests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ def typerize(
callback = ContextData.for_typer if callback is None else callback
callback = callback if not exclude_callback else None

tt = typer.Typer(help=cls.typer_help or cls.__doc__)
tt = typer.Typer(
help=cls.typer_help or cls.__doc__,
pretty_exceptions_short=True,
pretty_exceptions_enable=False,
)
if not exclude_callback:
assert callback is not None
tt.callback()(callback)
Expand Down

0 comments on commit 4bf2acb

Please sign in to comment.