From 3880414bbf2d6f2cd05e208abf919ae5ceabeddc Mon Sep 17 00:00:00 2001 From: Nick White Date: Thu, 27 Feb 2020 17:45:16 +0000 Subject: Reorganise all commands to be behind cmd/ --- boxtotxt/main.go | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 boxtotxt/main.go (limited to 'boxtotxt') diff --git a/boxtotxt/main.go b/boxtotxt/main.go deleted file mode 100644 index 058eb05..0000000 --- a/boxtotxt/main.go +++ /dev/null @@ -1,44 +0,0 @@ -package main - -import ( - "bufio" - "flag" - "fmt" - "log" - "os" - "strings" -) - -func main() { - flag.Usage = func() { - fmt.Fprintf(os.Stderr, "Usage: boxtotxt in.box\n") - flag.PrintDefaults() - } - flag.Parse() - if flag.NArg() != 1 { - flag.Usage() - os.Exit(1) - } - - f, err := os.Open(flag.Arg(0)) - defer f.Close() - if err != nil { - log.Fatalf("Could not open file %s: %v\n", flag.Arg(0), err) - } - - scanner := bufio.NewScanner(f) - - for scanner.Scan() { - t := scanner.Text() - s := strings.Split(t, "") - if len(s) < 1 { - continue - } - if s[0] == "\t" { - continue - } - fmt.Printf("%s", s[0]) - } - - fmt.Printf("\n") -} -- cgit v1.2.1-24-ge1ad