*: initial thoughts
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
commit
16b15e1c29
4 changed files with 334 additions and 0 deletions
39
cmd/gomtree/main.go
Normal file
39
cmd/gomtree/main.go
Normal file
|
@ -0,0 +1,39 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
_ = mtree.DirectoryHierarchy{}
|
||||
for _, file := range flag.Args() {
|
||||
func() {
|
||||
fh, err := os.Open(file)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
defer fh.Close()
|
||||
|
||||
s := bufio.NewScanner(fh)
|
||||
for s.Scan() {
|
||||
str := s.Text()
|
||||
switch {
|
||||
case strings.HasPrefix(str, "#"):
|
||||
continue
|
||||
default:
|
||||
}
|
||||
fmt.Printf("%q\n", str)
|
||||
}
|
||||
if err := s.Err(); err != nil {
|
||||
log.Println("ERROR:", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue