// Add an Alias for this command.
332127
func (c *CmdClause) Alias(name string) *CmdClause {
	c.aliases = append(c.aliases, name)
	return c
}
619137
func (t *Transaction) Command(name string, args redis.Args, handler ReplyHandler) {
	t.actions = append(t.actions, &Action{
		kind:    commandAction,
		name:    name,
		args:    args,
		handler: handler,
	})
}
979665
func NewIndexAlias(indexes ...Index) *indexAliasImpl {
	return &indexAliasImpl{
		name:    "alias",
		indexes: indexes,
		open:    true,
	}
}
590215
func (r *RootCMD) RegisterCMD(c *CMD) {
	// Set up the command
	if r.Subcommands == nil {
		r.Subcommands = make(map[string]*CMD)
	}
	r.Subcommands[c.Name] = c

	// Set up the alias
	if r.Aliases == nil {
		r.Aliases = make(map[string]string)
	}
	r.Aliases[c.Alias] = c.Name
}
258185
func (cli *NetworkCli) CmdServicePublish(chain string, args ...string) error {
	cmd := cli.Subcmd(chain, "publish", "SERVICE[.NETWORK]", "Publish a new service on a network", false)
	flAlias := opts.NewListOpts(netutils.ValidateAlias)
	cmd.Var(&flAlias, []string{"-alias"}, "Add alias to self")
	cmd.Require(flag.Exact, 1)
	err := cmd.ParseFlags(args, true)
	if err != nil {
		return err
	}

	sn, nn := parseServiceName(cmd.Arg(0))
	sc := serviceCreate{Name: sn, Network: nn, MyAliases: flAlias.GetAll()}
	obj, _, err := readBody(cli.call("POST", "/services", sc, nil))
	if err != nil {
		return err
	}

	var replyID string
	err = json.Unmarshal(obj, &replyID)
	if err != nil {
		return err
	}

	fmt.Fprintf(cli.out, "%s\n", replyID)
	return nil
}
294302
func (f Flag) Alias() string {
	if len(f.Name) > 1 {
		return f.Name[0:1]
	}
	return f.Name
}
149573
func (c *Commands) Register(cmdstr string, cf cmdfunc, helpMsg string) {
	for _, v := range c.cmds {
		if v.match(cmdstr) {
			v.cmdFn = cf
			return
		}
	}

	c.cmds = append(c.cmds, command{aliases: []string{cmdstr}, cmdFn: cf, helpMsg: helpMsg})
}
160272
func removeCmd(args []string, aliases *Aliases) error {
	if len(args) > 0 {
		alias := args[0]
		return aliases.Del(alias)
	}
	return errors.New("remove command requires a <name> of an alias")
}
963415
func CreateOptionAlias(name string, alias string) EndpointOption {
	return func(ep *endpoint) {
		if ep.aliases == nil {
			ep.aliases = make(map[string]string)
		}
		ep.aliases[alias] = name
	}
}
367233
func (cmd *CLI) AliasFlag(alias rune, flagname string) {
	flag, ok := cmd.flags[flagname]
	if !ok {
		panic(fmt.Sprintf("flag not defined %v", flagname))
	}
	if cmd.aliases == nil {
		cmd.aliases = make(map[rune]*Flag)
	}
	cmd.aliases[alias] = flag
}
418280
func (c *Conn) Command(commandName string, args ...interface{}) *Cmd {
	cmd := &Cmd{
		Name: commandName,
		Args: args,
	}
	c.removeRelatedCommands(commandName, args)
	c.commands = append(c.commands, cmd)
	return cmd
}
261850
func Alias(d string) {
	if r, ok := relationalModelDefinition(false); ok {
		r.Alias = d
	} else if f, ok := relationalFieldDefinition(false); ok {
		f.DatabaseFieldName = d
	}
}
442867
func (a *AliasAddAction) Source() (interface{}, error) {
	a.removeBlankIndexNames()
	if err := a.Validate(); err != nil {
		return nil, err
	}
	src := make(map[string]interface{})
	act := make(map[string]interface{})
	src["add"] = act
	act["alias"] = a.alias
	switch len(a.index) {
	case 1:
		act["index"] = a.index[0]
	default:
		act["indices"] = a.index
	}
	if a.filter != nil {
		f, err := a.filter.Source()
		if err != nil {
			return nil, err
		}
		act["filter"] = f
	}
	if len(a.routing) > 0 {
		act["routing"] = a.routing
	}
	if len(a.indexRouting) > 0 {
		act["index_routing"] = a.indexRouting
	}
	if len(a.searchRouting) > 0 {
		act["search_routing"] = a.searchRouting
	}
	if a.isWriteIndex != nil {
		act["is_write_index"] = *a.isWriteIndex
	}
	return src, nil
}
126619
func (m *MockLambdaAPI) UpdateAlias(arg0 *lambda.UpdateAliasInput) (*lambda.AliasConfiguration, error) {
	ret := m.ctrl.Call(m, "UpdateAlias", arg0)
	ret0, _ := ret[0].(*lambda.AliasConfiguration)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
2839
func (cmd *CLI) AddSubCommand(subcmd *SubCommand) *SubCommand {
	subcmd.ErrorHandling = cmd.ErrorHandling
	cmd.subCommands.Add(subcmd.name, subcmd)
	if subcmd.parent != nil {
		panic("command already assigned")
	}
	if &subcmd.CLI == cmd {
		panic("cannot assign subcmd to itself as a subcmd")
	}
	subcmd.parent = cmd
	return subcmd
}
595668
func (nd *Node) addAlias(aliasToAdd *Host) {
	// Aliases are only referenced in the cluster tend goroutine,
	// so synchronization is not necessary.
	aliases := nd.GetAliases()
	if aliases == nil {
		aliases = []*Host{}
	}

	aliases = append(aliases, aliasToAdd)
	nd.setAliases(aliases)
}
993899
func (a *App) Command(name string) *Command {
	for _, c := range a.Commands {
		if c.HasName(name) {
			return &c
		}
	}

	return nil
}