better dev command

This commit is contained in:
2026-09-25 19:04:01 -07:00
parent 75fc14f4ac
commit ebc0543535
2 changed files with 11 additions and 6 deletions
+8 -3
View File
@@ -27,6 +27,9 @@ class DevHelper:
# Core logic
def call(self, *args, **kwargs):
if not args:
print("Usage: dev <command> [args...]\n\nCommands:")
for command in self._commands():
print(f" {command}")
return
command, rest = args[0], args[1:]
@@ -136,14 +139,16 @@ class DevHelper:
raise NotImplementedError(f"Not implemented for platform {sys.platform}")
def bash_completions(self, *args, **kwargs):
completions = sorted(
print(" ".join(self._commands()))
# Private helpers
def _commands(self):
return sorted(
METHOD_TO_COMMAND.get(name, name)
for name in vars(DevHelper)
if not name.startswith("_") and name != "call" and callable(getattr(DevHelper, name))
)
print(" ".join(completions))
# Private helpers
def _parse_issue_url(self, url):
match = re.match(r"^(https?://[^/]+)/([^/]+)/([^/]+)/issues/(\d+)", url)
if match is None: