func (c *SuperCommand) RegisterSuperAlias(name, super, forName string, check DeprecationCheck) {
	if check != nil && check.Obsolete() {
		logger.Infof("%q alias not registered as it is obsolete", name)
		return
	}
	action, found := c.subcmds[super]
	if !found {
		panic(fmt.Sprintf("%q not found when registering alias", super))
	}
	if !action.command.IsSuperCommand() {
		panic(fmt.Sprintf("%q is not a SuperCommand", super))
	}
	superCmd := action.command.(*SuperCommand)

	action, found = superCmd.subcmds[forName]
	if !found {
		panic(fmt.Sprintf("%q not found as a command in %q", forName, super))
	}

	c.insert(commandReference{
		name:    name,
		command: action.command,
		alias:   super + " " + forName,
		check:   check,
	})
}
// RegisterSuperAlias makes a subcommand of a registered supercommand
// available under another name. This is useful when the command structure is
// being refactored.  If `check` is supplied, and the result of the `Obsolete`
// call is true, then the alias is not registered.
RegisterSuperAlias makes a subcommand of a registered supercommand
available under another name. This is useful when the command structure is
being refactored.  If `check` is supplied, and the result of the `Obsolete`
call is true, then the alias is not registered.
// RegisterSuperAlias makes a subcommand of a registered supercommand // available under another name . This is useful when the command structure is // being refactored . If ` check ` is supplied and the result of the ` Obsolete ` // call is true then the alias is not registered .
func (c *SuperCommand) RegisterSuperAlias(name, super, forName string, check DeprecationCheck) {
	if check != nil && check.Obsolete() {
		logger.Infof("%q alias not registered as it is obsolete", name)
		return
	}
	action, found := c.subcmds[super]
	if !found {
		panic(fmt.Sprintf("%q not found when registering alias", super))
	}
	if !action.command.IsSuperCommand() {
		panic(fmt.Sprintf("%q is not a SuperCommand", super))
	}
	superCmd := action.command.(*SuperCommand)
	action, found = superCmd.subcmds[forName]
	if !found {
		panic(fmt.Sprintf("%q not found as a command in %q", forName, super))
	}
	c.insert(commandReference{
		name:    name,
		command: action.command,
		alias:   super + " " + forName,
		check:   check,
	})
}
func ( c * SuperCommand ) RegisterSuperAlias ( name , super , forName string , check DeprecationCheck ) { if check != nil && check . Obsolete ( ) { logger . Infof ( " " , name ) return } action , found := c . subcmds [ super ] if ! found { panic ( fmt . Sprintf ( " " , super ) ) } if ! action . command . IsSuperCommand ( ) { panic ( fmt . Sprintf ( " " , super ) ) } superCmd := action . command . ( * SuperCommand ) action , found = superCmd . subcmds [ forName ] if ! found { panic ( fmt . Sprintf ( " " , forName , super ) ) } c . insert ( commandReference { name : name , command : action . command , alias : super + " " + forName , check : check , } ) }
RegisterSuperAlias makes a subcommand of a registered supercommand
available under another name.
RegisterSuperAlias makes a subcommand of a registered supercommand available under another name .