Skip to content

Commit

Permalink
✨ pass mulitple files to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Wytamma committed Jun 6, 2023
1 parent 4ba9afa commit fe83066
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions write_the/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def callback(

@app.async_command()
async def docs(
file: Path = typer.Argument(..., help="Path to the code file/folder."),
file: List[Path] = typer.Argument(..., help="Path to the code file/folder."),
nodes: List[str] = typer.Option(
None,
"--node",
Expand Down Expand Up @@ -97,11 +97,13 @@ async def docs(
"""
Document your code with AI.
"""
if file.is_dir():
files = list_python_files(file)
else:
assert file.suffix == ".py"
files = [file]
files = []
for f in file:
if f.is_dir():
files.extend(list_python_files(f))
else:
assert f.suffix == ".py"
files.append(f)
with Progress(
SpinnerColumn(),
TextColumn("{task.description}"),
Expand Down

0 comments on commit fe83066

Please sign in to comment.