summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Lord <davidism@gmail.com>2021-05-19 10:39:53 -0700
committerDavid Lord <davidism@gmail.com>2021-05-19 10:49:02 -0700
commit0db91e220517c767e1e81fd37d1dd7ce83fa77b7 (patch)
tree2196bcf99033d23889da55c1735a89c242c06e04 /examples
parent329b1001755452c96dcefcf4a3c799a2463710e0 (diff)
downloadclick-0db91e220517c767e1e81fd37d1dd7ce83fa77b7.tar.gz
return resolved name, not original name
Diffstat (limited to 'examples')
-rw-r--r--examples/aliases/aliases.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/aliases/aliases.py b/examples/aliases/aliases.py
index c3da657..af3caa6 100644
--- a/examples/aliases/aliases.py
+++ b/examples/aliases/aliases.py
@@ -67,6 +67,11 @@ class AliasedGroup(click.Group):
return click.Group.get_command(self, ctx, matches[0])
ctx.fail(f"Too many matches: {', '.join(sorted(matches))}")
+ def resolve_command(self, ctx, args):
+ # always return the command's name, not the alias
+ _, cmd, args = super().resolve_command(ctx, args)
+ return cmd.name, cmd, args
+
def read_config(ctx, param, value):
"""Callback that is used whenever --config is passed. We use this to