[Feature] Improvements to handling charts on the CLI results (#6544)

* better handling of the chart arg: falls back to charting.to_chart() and only then, if not possible to display falls back to the print_rich_table()

* handling chart arguments aka unknown arguments

* propagating changes on return type of parse_simple_args to choices.py for coherency
This commit is contained in:
Henrique Joaquim
2024-06-26 14:08:56 +01:00
committed by GitHub
parent 37903a1cae
commit 5e69ce3d25
5 changed files with 134 additions and 47 deletions

View File

@@ -80,7 +80,7 @@ class SettingsController(BaseController):
description=field["description"],
add_help=False,
)
ns_parser = self.parse_simple_args(parser, other_args)
ns_parser, _ = self.parse_simple_args(parser, other_args)
if ns_parser:
session.settings.set_item(
field_name, not getattr(session.settings, field_name)
@@ -113,7 +113,7 @@ class SettingsController(BaseController):
type=type_, # type: ignore[arg-type]
choices=choices,
)
ns_parser = self.parse_simple_args(parser, other_args)
ns_parser, _ = self.parse_simple_args(parser, other_args)
if ns_parser:
if ns_parser.value:
# Console style is applied immediately