Skip to content

Commit

Permalink
Add CLI option to list available codemods
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella committed Nov 30, 2023
1 parent c3ae70b commit 2a72464
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pixee/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,15 @@ def fix(path):
subprocess.run([PYTHON_CODEMODDER, path, "--output", output_path], check=True)


@main.command()
def codemods():
"""List available codemods"""
console.print("Available codemods:", style="bold")
result = subprocess.run(
[PYTHON_CODEMODDER, "--list"], stdout=subprocess.PIPE, check=True
)
console.print(result.stdout.decode("utf-8").splitlines())


if __name__ == "__main__":
main()

0 comments on commit 2a72464

Please sign in to comment.