tree using module instead of modules
This commit is contained in:
@@ -127,28 +127,27 @@ def serve(
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
"--modules",
|
||||
multiple=True,
|
||||
"--module",
|
||||
required=True,
|
||||
help="Python module import paths to introspect",
|
||||
help="Python module import path to introspect",
|
||||
)
|
||||
@click.option(
|
||||
"--project-name",
|
||||
help="Project name (defaults to first module)",
|
||||
help="Project name (defaults to specified module)",
|
||||
)
|
||||
def tree(
|
||||
modules: Sequence[str],
|
||||
module: str,
|
||||
project_name: Optional[str],
|
||||
) -> None:
|
||||
"""
|
||||
Visualize the project structure in the terminal.
|
||||
|
||||
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.
|
||||
"""
|
||||
loader = GriffeLoader()
|
||||
project = loader.load_project(list(modules), project_name)
|
||||
project = loader.load_project([module], project_name)
|
||||
|
||||
click.echo(project.name)
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ def serve(
|
||||
) -> None: ...
|
||||
|
||||
def tree(
|
||||
modules: Sequence[str],
|
||||
module: str,
|
||||
project_name: Optional[str],
|
||||
) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user