def get_command(self, ctx, cmd_name):
    global _config
    if (_config is None):
        _config = Config()
        cfg_file = os.path.join(os.path.dirname(__file__), 'aliases.ini')
        _config.read_config(cfg_file)
    rv = click.Group.get_command(self, ctx, cmd_name)
    if (rv is not None):
        return rv
    if (cmd_name in _config.aliases):
        actual_cmd = _config.aliases[cmd_name]
        return click.Group.get_command(self, ctx, actual_cmd)
    matches = [x for x in self.list_commands(ctx) if x.lower().startswith(cmd_name.lower())]
    if (not matches):
        return None
    elif (len(matches) == 1):
        return click.Group.get_command(self, ctx, matches[0])
    ctx.fail(('Too many matches: %s' % ', '.join(sorted(matches))))
def get_command(self, ctx, cmd_name):
    global _config
    if (_config is None):
        _config = Config()
        cfg_file = os.path.join(os.path.dirname(__file__), 'aliases.ini')
        _config.read_config(cfg_file)
    rv = click.Group.get_command(self, ctx, cmd_name)
    if (rv is not None):
        return rv
    if (cmd_name in _config.aliases):
        actual_cmd = _config.aliases[cmd_name]
        return click.Group.get_command(self, ctx, actual_cmd)
    matches = [x for x in self.list_commands(ctx) if x.lower().startswith(cmd_name.lower())]
    if (not matches):
        return None
    elif (len(matches) == 1):
        return click.Group.get_command(self, ctx, matches[0])
    ctx.fail(('Too many matches: %s' % ', '.join(sorted(matches))))