ruspa/main.go

27 lines
416 B
Go
Raw Normal View History

2020-03-01 23:09:00 +01:00
package main
import (
"flag"
"fmt"
"time"
)
func main() {
var path string
var depth int
flag.StringVar(&path, "path", ".", "Path from where to start the walk from")
flag.IntVar(&depth, "depth", 0, "Depth to display")
flag.Parse()
t := NewTop(path)
go t.Spawn(depth)
go t.Collect()
for {
select {
case <-time.After(500 * time.Millisecond):
fmt.Printf("\033[H\033[2J")
fmt.Println(t)
}
}
}