Skip to content

Commit

Permalink
Rename subcommands to cmds for shorter filepaths
Browse files Browse the repository at this point in the history
  • Loading branch information
WyattBlue committed Jan 12, 2025
1 parent a333eb0 commit 2bfd867
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 19 deletions.
19 changes: 4 additions & 15 deletions auto_editor/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,21 +286,10 @@ def get_domain(url: str) -> str:


def main() -> None:
subcommands = (
"test",
"info",
"levels",
"subdump",
"desc",
"repl",
"palet",
"cache",
)

if len(sys.argv) > 1 and sys.argv[1] in subcommands:
obj = __import__(
f"auto_editor.subcommands.{sys.argv[1]}", fromlist=["subcommands"]
)
commands = ("test", "info", "levels", "subdump", "desc", "repl", "palet", "cache")

if len(sys.argv) > 1 and sys.argv[1] in commands:
obj = __import__(f"auto_editor.cmds.{sys.argv[1]}", fromlist=["cmds"])
obj.main(sys.argv[2:])
return

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ homepage = "https://auto-editor.com"

[project.scripts]
"auto-editor" = "auto_editor.__main__:main"
aedesc = "auto_editor.subcommands.desc:main"
aeinfo = "auto_editor.subcommands.info:main"
aesubdump = "auto_editor.subcommands.subdump:main"
aelevels = "auto_editor.subcommands.levels:main"
aedesc = "auto_editor.cmds.desc:main"
aeinfo = "auto_editor.cmds.info:main"
aesubdump = "auto_editor.cmds.subdump:main"
aelevels = "auto_editor.cmds.levels:main"

[tool.mypy]
warn_unused_ignores = true
Expand Down

0 comments on commit 2bfd867

Please sign in to comment.