INNER CODE UNIT · Go
sortedAliases
dropbox/dbxcli · tools/gen-docs/main.go:240
func sortedAliases(command *cobra.Command) []string {
if command == nil || len(command.Aliases) == 0 {
return nil
}
aliases := append([]string{}, command.Aliases...)
sort.Strings(aliases)
return aliases
}
func relativeCommandPath(command *cobra.Command) string {
if command == nil {
return ""
}
path := command.CommandPath()
if command.Root() != nil {
rootName := command.Root().Name()
if path == rootName {
return path