rclone/vendor/github.com/a8m/tree
2017-11-06 11:23:27 +00:00
..
cmd/tree vendor: update all dependencies to latest versions 2017-09-30 15:27:27 +01:00
.gitignore vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
.travis.yml vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
color_test.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
color.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
compileall.sh vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
csort_bsd.go vendor: update github.com/a8m/tree - fixes #1797 2017-11-06 11:23:27 +00:00
csort_generic.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
csort_unix.go vendor: update github.com/a8m/tree - fixes #1797 2017-11-06 11:23:27 +00:00
modes_bsd.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
modes_unix.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
modes_unsupported.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
node_test.go vendor: update all dependencies to latest versions 2017-09-30 15:27:27 +01:00
node.go vendor: update all dependencies to latest versions 2017-09-30 15:27:27 +01:00
README.md vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
sort.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
stat_unix.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
stat_unsupported.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00

tree Build status License

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

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