Remove positional argument placeholders from alias_command.

    Args:
        alias_command: The alias command to remove from.

    Returns:
        The alias command string without positional argument placeholder.
486007
def remove_pos_arg_placeholders(alias_command):
    
    # Boundary index is the index at which named argument or positional argument starts
    split_command = shlex.split(alias_command)
    boundary_index = len(split_command)
    for i, subcommand in enumerate(split_command):
        if not re.match('^[a-z]', subcommand.lower()) or i > COLLISION_CHECK_LEVEL_DEPTH:
            boundary_index = i
            break

    return ' '.join(split_command[:boundary_index]).lower()
199469
def _validate_alias_file_content(alias_file_path, url=''):
    
    alias_table = get_config_parser()
    try:
        alias_table.read(alias_file_path)
        for alias_name, alias_command in reduce_alias_table(alias_table):
            _validate_alias_name(alias_name)
            _validate_alias_command(alias_command)
            _validate_alias_command_level(alias_name, alias_command)
            _validate_pos_args_syntax(alias_name, alias_command)
    except Exception as exception:  # pylint: disable=broad-except
        error_msg = CONFIG_PARSING_ERROR % AliasManager.process_exception_message(exception)
        error_msg = error_msg.replace(alias_file_path, url or alias_file_path)
        raise CLIError(error_msg)
263342
def remove_alias(agent, prefix, alias):
    """"""
    return _broadcast(agent, RemoveMappingManager, RecordType.record_CNAME,
                      prefix, alias)
1127530
def filter_alias_create_namespace(namespace):
    
    def filter_string(s):
        return ' '.join(s.strip().split())

    namespace.alias_name = filter_string(namespace.alias_name)
    namespace.alias_command = filter_string(namespace.alias_command)
    return namespace
436149
def remove_aliases(self_or_cls, aliases):
        
        for k,v in self_or_cls.aliases.items():
            if v in aliases:
                self_or_cls.aliases.pop(k)
267519
def process_alias_create_namespace(namespace):
    
    namespace = filter_alias_create_namespace(namespace)
    _validate_alias_name(namespace.alias_name)
    _validate_alias_command(namespace.alias_command)
    _validate_alias_command_level(namespace.alias_name, namespace.alias_command)
    _validate_pos_args_syntax(namespace.alias_name, namespace.alias_command)
181707
def do_unalias(self, arg):
        
        args = arg.split()
        if len(args) == 0: return
        if args[0] in self.aliases:
            del self.aliases[args[0]]
753251
def create_alias(alias_name, alias_command):
    
    alias_name, alias_command = alias_name.strip(), alias_command.strip()
    alias_table = get_alias_table()
    if alias_name not in alias_table.sections():
        alias_table.add_section(alias_name)

    alias_table.set(alias_name, 'command', alias_command)
    _commit_change(alias_table)
468228
def find_flag_alias(self, flag):
        
        for each in self.opt_names:
            if flag in each:
                result = set(each)  # a copy
                result.remove(flag)
                return result
        return None
888686
def unregister(self, command):
        
        if command not in self._commands.keys():
            self.log.warning("Can not unregister command %s" % command)
        else:
            # Click does not have any kind of a function to unregister/remove/deactivate already added commands.
            # So we need to delete the related objects manually from the click internal commands dictionary for
            # our root command.
            del(self._click_root_command.commands[command])
            # Finally lets delete the command from our internal dictionary too.
            del(self._commands[command])
            self.log.debug("Command %s got unregistered" % command)
80908
def profile_remove_command(profile_command)
      profile_command.desc _('cli.profile.remove.desc')
      profile_command.command :remove do |profile_remove_command|
        profile_remove_command.action do |global_options,options,args|
          Bebox::ProfileWizard.new.remove_profile(project_root)
        end
      end
    end
1326096
function func_help_cmd_aliases(arg_terminal_feature, arg_response, cmd, opd1, opd2, opd3)
{
    arg_response.result.value = []
    if ( arg_terminal_feature && arg_terminal_feature.is_terminal_feature && arg_terminal_feature._terminal)
    {
        const features = arg_terminal_feature._terminal.get_features()

        const feature_name = opd1 ? opd1 : arg_terminal_feature._terminal.get_mode()
        if (! feature_name)
        {
            arg_response.result.error = 'no selected feature for command :[' + cmd + ']'
            return arg_response
        }

        const feature = (feature_name in features) ? features[feature_name] : undefined
        if (! feature)
        {
            arg_response.result.error = 'no feature [' + feature_name + '] for command :[' + cmd + ']'
            return arg_response
        }

        const aliases = feature.get_aliases()
        console.log(context + ':eval aliases=', aliases)

        // arg_response.result.value = JSON.stringify(aliases)
        arg_response.result.value = aliases
        arg_response.result.str = func_help_format_aliases(aliases)
    }
}
209742
def handle_unset_command(self, line: str, position: int, tokens: ParseResults) -> ParseResults:
        
        key = tokens['key']
        self.validate_unset_command(line, position, key)
        del self.annotations[key]
        return tokens
23546
def command(self, *args, **kwargs):
        
        aliases = kwargs.pop('aliases', None)
        decorator = super(ProfilingCLI, self).command(*args, **kwargs)
        if aliases is None:
            return decorator
        def _decorator(f):
            cmd = decorator(f)
            for alias in aliases:
                self.command_name_aliases[alias] = cmd.name
            return cmd
        return _decorator
608378
def get_alias(self, alias):
        
        alias = alias or {}
        return [k for k, v in alias.items() if self.mnemonic in v]
873848
def _manage_commands():
    
    for name, (command, *aliases) in COMMANDS.items():
        COMMAND_MAPPER[name] = command
        for alias in aliases:
            COMMAND_MAPPER[alias] = command
        COMMAND_ALIASES[name] = aliases
229693
public String removeResourceAlias(String alias)
    {
        if (_resourceAliases == null)
            return null;
        return (String)_resourceAliases.remove(alias);
    }