Skip to content
Snippets Groups Projects
Commit ebcfe75b authored by Nicolas Dandrimont's avatar Nicolas Dandrimont
Browse files

Make cli aliases a plain dict

Makes it easier to save/restore it in test fixtures.
parent 74468892
No related branches found
No related tags found
No related merge requests found
......@@ -24,14 +24,9 @@ class AliasedGroup(click.Group):
def __init__(self, name=None, commands=None, **attrs):
self.option_notes = attrs.pop('option_notes', None)
self.aliases = {}
super().__init__(name, commands, **attrs)
@property
def aliases(self):
if not hasattr(self, '_aliases'):
self._aliases = {}
return self._aliases
def get_command(self, ctx, cmd_name):
return super().get_command(ctx, self.aliases.get(cmd_name, cmd_name))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment