mirror of
https://github.com/docling-project/docling.git
synced 2026-05-17 13:10:38 +00:00
docs(cli): clarify help text (#3408)
fix(cli): clarify help text Fix confusing CLI help output by correcting wording and aligning the source argument name. Signed-off-by: Jefsky <hwj3344@hotmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+6
-6
@@ -408,7 +408,7 @@ def export_documents(
|
||||
|
||||
@app.command(no_args_is_help=True)
|
||||
def convert( # noqa: C901
|
||||
input_sources: Annotated[
|
||||
source: Annotated[
|
||||
list[str],
|
||||
typer.Argument(
|
||||
...,
|
||||
@@ -419,7 +419,7 @@ def convert( # noqa: C901
|
||||
from_formats: list[InputFormat] = typer.Option(
|
||||
None,
|
||||
"--from",
|
||||
help="Specify input formats to convert from. Defaults to all formats.",
|
||||
help="Input formats to accept. Defaults to all supported formats.",
|
||||
),
|
||||
to_formats: list[OutputFormat] = typer.Option(
|
||||
None, "--to", help="Specify output formats. Defaults to Markdown."
|
||||
@@ -594,7 +594,7 @@ def convert( # noqa: C901
|
||||
debug_visualize_layout: Annotated[
|
||||
bool,
|
||||
typer.Option(
|
||||
..., help="Enable debug output which visualizes the layour clusters"
|
||||
..., help="Enable debug output which visualizes the layout clusters"
|
||||
),
|
||||
] = False,
|
||||
debug_visualize_tables: Annotated[
|
||||
@@ -677,13 +677,13 @@ def convert( # noqa: C901
|
||||
|
||||
with tempfile.TemporaryDirectory() as tempdir:
|
||||
input_doc_paths: list[Path] = []
|
||||
for src in input_sources:
|
||||
for src in source:
|
||||
try:
|
||||
# check if we can fetch some remote url
|
||||
source = resolve_source_to_path(
|
||||
resolved_source = resolve_source_to_path(
|
||||
source=src, headers=parsed_headers, workdir=Path(tempdir)
|
||||
)
|
||||
input_doc_paths.append(source)
|
||||
input_doc_paths.append(resolved_source)
|
||||
except FileNotFoundError:
|
||||
err_console.print(
|
||||
f"[red]Error: The input file {src} does not exist.[/red]"
|
||||
|
||||
@@ -14,6 +14,11 @@ runner = CliRunner()
|
||||
def test_cli_help():
|
||||
result = runner.invoke(app, ["--help"])
|
||||
assert result.exit_code == 0
|
||||
assert "Input formats to" in result.output
|
||||
assert "all supported" in result.output
|
||||
assert "layout clusters" in result.output
|
||||
assert "layour" not in result.output
|
||||
assert "input_sources" not in result.output
|
||||
|
||||
|
||||
def test_cli_version():
|
||||
|
||||
Reference in New Issue
Block a user