tree

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Name:  "tree",
	Usage: "Display directory structure",
	Flags: []cli.Flag{
		&cli.IntFlag{Name: "depth, L", Value: 3, Usage: "Maximum depth"},
	},
	Action: func(ctx context.Context, cmd *cli.Command) error {
		depth := cmd.Int("depth")
		dirs := cmd.Args().Slice()

		if len(dirs) == 0 {
			dirs = []string{"."}
		}

		for _, dir := range dirs {
			fmt.Println(dir)
			printTree(dir, "", depth, true)
		}
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL