def METHOD_NAME(self, ctx, cmd_name):
    rv = click.Group.METHOD_NAME(self, ctx, cmd_name)
    if rv is not None:
        return rv
    matches = [x for x in self.list_commands(ctx)
               if x.startswith(cmd_name)]
    if not matches:
        return None
    if len(matches) == 1:
        return click.Group.METHOD_NAME(self, ctx, matches[0])
    ctx.fail('Too many matches: %s' % ', '.join(sorted(matches)))
    return None