// FullName returns the full name of the command.
// For subcommands this ensures that parent commands are part of the command path
438814
func (c Command) FullName() string {
	if c.commandNamePath == nil {
		return c.Name
	}
	return strings.Join(c.commandNamePath, " ")
}
675738
func baseName(name string) string {
	// First, find the last element
	if i := strings.LastIndex(name, "/"); i >= 0 {
		name = name[i+1:]
	}
	// Now drop the suffix
	if i := strings.LastIndex(name, "."); i >= 0 {
		name = name[0:i]
	}
	return name
}
99180
func checkName(name string) error {
	if len(name) == 0 {
		return fmt.Errorf("No name given for tar element.")
	}
	comp := strings.Split(name, string(os.PathSeparator))
	if len(comp) > 0 && comp[0] == "" {
		return fmt.Errorf("No absolute paths allowed.")
	}
	for i, c := range comp {
		switch {
		case c == "" && i != len(comp)-1:
			// don't allow an empty name, unless it is the last element... handles
			// cases where we may have "./" come in as the name
			return fmt.Errorf("Empty name in file path.")
		case c == "..":
			return fmt.Errorf("Double dots not allowed in path.")
		}
	}
	return nil
}
256302
func Truename(filePath string) (string, error) {
	p, err := filepath.EvalSymlinks(filePath)
	if err != nil {
		return filePath, err
	}
	p, err = filepath.Abs(p)
	if err != nil {
		return filePath, err
	}
	return filepath.Clean(p), nil
}
210328
func funcname(name string) string {
	i := strings.LastIndex(name, "/")
	name = name[i+1:]
	i = strings.Index(name, ".")
	return name[i+1:]
}
351526
func cmdWithFullCommand(command string) (cmd runableCmd, ok bool) {
	for _, cmd := range cli.commands {
		if cmd.FullCommand() == command {
			return cmd, true
		}
	}

	return cmd, false
}
502682
func (n *roFileVersion) fullPath() string {
	if n == nil {
		return ""
	}
	return filepath.Join(n.parent.fullPath(), n.name)
}
265580
func (c PluginCommand) CommandName() string {
	if c.Name != "" && c.Alias != "" {
		return fmt.Sprintf("%s, %s", c.Name, c.Alias)
	}
	return c.Name
}
816778
func (cmd *CLI) AliasName(alias, subCommand string) {
	if cmd.nameAliases == nil {
		cmd.nameAliases = make(map[string]string)
	}
	cmd.nameAliases[alias] = subCommand
}
1009044
func GetFullName(schema Schema) string {
	switch sch := schema.(type) {
	case *RecordSchema:
		return getFullName(sch.GetName(), sch.Namespace)
	case *EnumSchema:
		return getFullName(sch.GetName(), sch.Namespace)
	case *FixedSchema:
		return getFullName(sch.GetName(), sch.Namespace)
	default:
		return schema.GetName()
	}
}
129921
func (builder *SearchCommandBuilder) WithIndexName(index string) *SearchCommandBuilder {
	builder.protobuf.Index = []byte(index)
	return builder
}
1174009
func (c *Command) Subcommand(name string) *Command {
	for _, sub := range c.Subcommands {
		if sub.Name == name {
			return sub
		}
		for _, a := range sub.Aliases {
			if a == name {
				return sub
			}
		}
	}
	return nil
}
596122
func (c *ModelCommandBase) ControllerName() (string, error) {
	c.assertRunStarted()
	if err := c.maybeInitModel(); err != nil {
		return "", errors.Trace(err)
	}
	return c._controllerName, nil
}
313417
func (c *ModelCommandBase) ModelName() (string, error) {
	c.assertRunStarted()
	if err := c.maybeInitModel(); err != nil {
		return "", errors.Trace(err)
	}
	return c._modelName, nil
}
1196415
func (s *Step) ShortName() string {
	parts := strings.Split(s.Name, "|")
	if len(parts) == 0 {
		return "ERROR: EMPTY NAME"
	}
	return parts[len(parts)-1]
}
1229040
func (p *PushEventRepository) GetFullName() string {
	if p == nil || p.FullName == nil {
		return ""
	}
	return *p.FullName
}
259620
func (container *Container) FullHostname() string {
	fullHostname := container.Config.Hostname
	if container.Config.Domainname != "" {
		fullHostname = fmt.Sprintf("%s.%s", fullHostname, container.Config.Domainname)
	}
	return fullHostname
}