-
Notifications
You must be signed in to change notification settings - Fork 7
Group commands by origin and some other improvements #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
built_in_commands = [cmd_info for cmd_info in self._commands.values() if cmd_info.type == CommandType.built_in] | ||
|
||
print_grouped_commands({None: {None: built_in_commands}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
built-in commands do not have origin
or namespace
so they are None
@@ -205,7 +205,7 @@ def method_wrapper(tome_api, parser, *args, **kwargs): # noqa | |||
super().__init__(method=method_wrapper) | |||
|
|||
basename = os.path.basename(script)[len("tome_") :] | |||
self._name = os.path.splitext(basename)[0].replace("_", "-") | |||
self._name = basename.replace("_", "-").replace(".", "-") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shell commands will have the -sh
or -bat
suffix added to the name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, otherwise looks good to-me
@@ -144,7 +144,19 @@ def _add_cache_commands(self): | |||
"""Load tome scripts installed in the cache.""" | |||
|
|||
tome_scripts_path = TomePaths(self._tome_api.cache_folder).scripts_path | |||
for origin in os.listdir(tome_scripts_path): | |||
|
|||
# FIXME: should we error out if commands overlap? should we allow multiple commands with the same name? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that at least a warning should be produced
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I wanted a warning too, but the problem is that for the easy way of showing the warning it will be shown everytime tome is invoked, the ideal would be to show that on install but when installing the commands are not loaded...
WIP to have more visibility over installation origins and also cleaning up a bit...
This is how tome list would look now: