Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions codelimit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,29 @@ def list_commands(self, ctx: Context):
@cli.command(help="Check file(s)")
def check(
paths: Annotated[List[Path], typer.Argument(exists=True)],
exclude: Annotated[
Optional[list[str]], typer.Option(help="Glob patterns for exclusion")
] = None,
quiet: Annotated[
bool, typer.Option("--quiet", help="No output when successful")
] = False,
):
if exclude:
Configuration.excludes.extend(exclude)
check_command(paths, quiet)


@cli.command(help="Scan a codebase")
def scan(
path: Annotated[
Path, typer.Argument(exists=True, file_okay=False, help="Codebase root")
] = Path(".")
] = Path("."),
exclude: Annotated[
Optional[list[str]], typer.Option(help="Glob patterns for exclusion")
] = None
):
if exclude:
Configuration.excludes.extend(exclude)
scan_command(path)


Expand Down Expand Up @@ -68,9 +78,6 @@ def main(
verbose: Annotated[
Optional[bool], typer.Option("--verbose", "-v", help="Verbose output")
] = False,
exclude: Annotated[
Optional[list[str]], typer.Option(help="Glob patterns for exclusion")
] = None,
version: Annotated[
Optional[bool],
typer.Option(
Expand All @@ -83,8 +90,6 @@ def main(
Configuration.verbose = True
if version:
raise typer.Exit()
if exclude:
Configuration.excludes.extend(exclude)


if __name__ == "__main__":
Expand Down
Loading