fix(cli): broken --show-config command (#419)

Fix and improve the command.
This commit is contained in:
Jérome Eertmans
2024-04-17 20:33:44 +02:00
committed by GitHub
parent d5c20d1791
commit bd04dae2bf
3 changed files with 16 additions and 7 deletions

View File

@ -15,9 +15,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added CI for broken HTML links and fixed, plus spell checking.
[#417](https://github.com/jeertmans/manim-slides/pull/417)
- Create FAQ page and clear FAQ from README.md
- Create FAQ page and clear FAQ from README.md.
[#418](https://github.com/jeertmans/manim-slides/pull/418)
(unreleased-fixed)=
### Fixed
- Fixed broken `--show-config` command.
[#419](https://github.com/jeertmans/manim-slides/pull/419)
(v5.1.4)=
## [v5.1.4](https://github.com/jeertmans/manim-slides/compare/v5.1.3...v5.1.4)

View File

@ -25,7 +25,7 @@ Questions related to `manim-slides render [SCENES]...`,
### I cannot render with ManimGL
ManimGL support is only garanteed to work
ManimGL support is only guaranteed to work
on a very minimal set of versions, because it differs quite a lot from ManimCE,
and its development is not very active.

View File

@ -568,11 +568,14 @@ def show_config_options(function: Callable[..., Any]) -> Callable[..., Any]:
to = ctx.params.get("to", "html")
converter = Converter.from_string(to)(
presentation_configs=[PresentationConfig()]
)
for key, value in converter.dict().items():
click.echo(f"{key}: {value!r}")
converter = Converter.from_string(to)
for key, field in converter.model_fields.items():
if field.is_required():
continue
default = field.get_default(call_default_factory=True)
click.echo(f"{key}: {default}")
ctx.exit()