tree using module instead of modules

This commit is contained in:
2026-01-22 17:47:59 +05:30
parent cb68b0b93f
commit 8a509e590a
2 changed files with 7 additions and 8 deletions

View File

@@ -127,28 +127,27 @@ def serve(
@cli.command() @cli.command()
@click.option( @click.option(
"--modules", "--module",
multiple=True,
required=True, required=True,
help="Python module import paths to introspect", help="Python module import path to introspect",
) )
@click.option( @click.option(
"--project-name", "--project-name",
help="Project name (defaults to first module)", help="Project name (defaults to specified module)",
) )
def tree( def tree(
modules: Sequence[str], module: str,
project_name: Optional[str], project_name: Optional[str],
) -> None: ) -> None:
""" """
Visualize the project structure in the terminal. Visualize the project structure in the terminal.
Args: Args:
modules: List of module import paths to recursively introspect. module: The module import path to recursively introspect.
project_name: Optional override for the project name shown at the root. project_name: Optional override for the project name shown at the root.
""" """
loader = GriffeLoader() loader = GriffeLoader()
project = loader.load_project(list(modules), project_name) project = loader.load_project([module], project_name)
click.echo(project.name) click.echo(project.name)

View File

@@ -26,7 +26,7 @@ def serve(
) -> None: ... ) -> None: ...
def tree( def tree(
modules: Sequence[str], module: str,
project_name: Optional[str], project_name: Optional[str],
) -> None: ... ) -> None: ...