Skip to content

Commit

Permalink
feat: Add CLI options for alias resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jan 14, 2022
1 parent 9c6317e commit 87a59cb
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/griffe/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,24 @@ def get_parser() -> argparse.ArgumentParser:
"-o",
"--output",
default=sys.stdout,
help="Output file. Supports templating to output each package in its own file, with {{package}}.",
parser.add_argument(
"-r",
"--resolve-aliases",
action="store_true",
help="Whether to resolve aliases.",
)
parser.add_argument(
"-I",
"--resolve-implicit",
action="store_true",
help="Whether to resolve implicitely exported aliases as well. "
"Aliases are explicitely exported when defined in '__all__'.",
)
parser.add_argument(
"-U",
"--resolve-external",
action="store_true",
help="Whether to resolve aliases pointing to external/unknown modules (not loaded directly).",
)
parser.add_argument(
"-s",
Expand Down Expand Up @@ -206,6 +223,9 @@ def main(args: list[str] | None = None) -> int: # noqa: WPS231
search,
opts.docstyle,
opts.docopts,
opts.resolve_aliases,
not opts.resolve_implicit,
not opts.resolve_external,
)
packages = loader.modules_collection.members

Expand Down

0 comments on commit 87a59cb

Please sign in to comment.