Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "hitree", Short: "Print tree structure of the directory", Long: `Golang implementation of popular tree command from linux. Note: windows 10 has issue with ansi color, so for this release color output will be disabled on windows platform. `, PersistentPreRun: func(cmd *cobra.Command, args []string) { nocolor := (viper.GetBool("nocolor") || (runtime.GOOS == "windows")) tree.InitAurora(!nocolor) initOptions() setColorOption(cmd, &opt.DirColor, "dircolor") setColorOption(cmd, &opt.FileColor, "filecolor") setColorOption(cmd, &opt.SymLinkColor, "symlinkcolor") setColorOption(cmd, &opt.PipeColor, "pipecolor") setColorOption(cmd, &opt.TLinkColor, "tlinkcolor") setColorOption(cmd, &opt.LLinkColor, "llinkcolor") }, RunE: func(cmd *cobra.Command, args []string) error { showVersion, _ := cmd.Flags().GetBool("version") if showVersion { release.Print() return nil } path := "." if len(args) >= 1 { path = args[0] } root, err := tree.TraverseDir(path, opt, 0) if err != nil { return err } return sendOutput(cmd, root) }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.