cloudly-min/.rclone_repo/vendor/github.com/a8m/tree
bel c8eb52f9ba overdue 2020-01-13 03:37:51 +00:00
..
.gitignore overdue 2020-01-13 03:37:51 +00:00
.travis.yml overdue 2020-01-13 03:37:51 +00:00
LICENSE overdue 2020-01-13 03:37:51 +00:00
README.md overdue 2020-01-13 03:37:51 +00:00
color.go overdue 2020-01-13 03:37:51 +00:00
compileall.sh overdue 2020-01-13 03:37:51 +00:00
csort_bsd.go overdue 2020-01-13 03:37:51 +00:00
csort_generic.go overdue 2020-01-13 03:37:51 +00:00
csort_unix.go overdue 2020-01-13 03:37:51 +00:00
modes_bsd.go overdue 2020-01-13 03:37:51 +00:00
modes_unix.go overdue 2020-01-13 03:37:51 +00:00
modes_unsupported.go overdue 2020-01-13 03:37:51 +00:00
node.go overdue 2020-01-13 03:37:51 +00:00
sort.go overdue 2020-01-13 03:37:51 +00:00
stat_unix.go overdue 2020-01-13 03:37:51 +00:00
stat_unsupported.go overdue 2020-01-13 03:37:51 +00:00

README.md

tree Build status License

An implementation of the tree command written in Go, that can be used programmatically.

tree command

Installation:

$ go get github.com/a8m/tree/cmd/tree

How to use tree programmatically ?

You can take a look on cmd/tree, and s3tree or see the example below.

import (
    "github.com/a8m/tree"
)

func main() {
    opts := &tree.Options{
        // Fs, and OutFile are required fields.
        // fs should implement the tree file-system interface(see: tree.Fs),
        // and OutFile should be type io.Writer
        Fs: fs,
        OutFile: os.Stdout,
        // ...
    }
    inf.New("root-dir")
    // Visit all nodes recursively
    inf.Visit(opts)
    // Print nodes 
    inf.Print(opts)
}

License

MIT