Skip to content

Instantly share code, notes, and snippets.

@tsibley
Created July 5, 2022 21:33
Show Gist options
  • Select an option

  • Save tsibley/72fc19d5028d4b8595797bb5567958bd to your computer and use it in GitHub Desktop.

Select an option

Save tsibley/72fc19d5028d4b8595797bb5567958bd to your computer and use it in GitHub Desktop.
diff --git a/augur/__init__.py b/augur/__init__.py
index 31ee6826..a69dcf44 100644
--- a/augur/__init__.py
+++ b/augur/__init__.py
@@ -142,4 +142,9 @@ def command_name(command):
package = command.__package__
module_name = command.__name__
+ # If the command module is also a package, e.g. augur/x/__init__.py instead
+ # of augur/x.py, then use the parent package.
+ if package == module_name:
+ package = package.rsplit(".", 1)[0]
+
return remove_prefix(package, module_name).lstrip(".").replace("_", "-")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment