rclone/vendor/github.com/a8m/tree
Nick Craig-Wood 6427029c4e vendor: update all dependencies
* Update all dependencies
  * Remove all `[[constraint]]` from Gopkg.toml
  * Add in the minimum number of `[[override]]` to build
  * Remove go get of github.com/inconshreveable/mousetrap as it is vendored
  * Update docs with new policy on constraints
2018-05-05 15:52:24 +01: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
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_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: 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