rclone/vendor/github.com/a8m/tree
2018-08-28 16:08:48 +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.go vendor: add github.com/a8m/tree 2017-07-26 23:06:48 +01:00
compileall.sh vendor: switch to using go1.11 modules 2018-08-28 16:08: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
LICENSE vendor: update all dependencies 2018-05-05 15:52:24 +01: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.go vendor: update all dependencies to latest versions 2017-09-30 15:27:27 +01:00
README.md vendor: update all dependencies to latest versions 2018-01-16 13:20:59 +00: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.

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