1
0
mirror of https://github.com/thebaer/tildes.git synced 2018-07-20 07:15:21 +00:00

Accept -o (output) flag, extract src path into const

This commit is contained in:
Matt Baer 2015-01-27 16:16:32 -05:00
parent caf129870d
commit 43b5413b79

View File

@ -4,6 +4,7 @@ import (
"os" "os"
"fmt" "fmt"
"time" "time"
"flag"
"sort" "sort"
"bufio" "bufio"
"strconv" "strconv"
@ -11,11 +12,17 @@ import (
"text/template" "text/template"
) )
const scores = "/home/krowbar/Code/irc/tildescores.txt"
func main() { func main() {
fmt.Println("Starting...") fmt.Println("Starting...")
// Get any arguments
outPtr := flag.String("o", "tildescores", "Output file name")
flag.Parse()
headers := []string{ "User", "Tildes", "Last Collection" } headers := []string{ "User", "Tildes", "Last Collection" }
generate("tilde collectors", sortScore(readData("/home/krowbar/Code/irc/tildescores.txt", "&^%", headers)), "tildes") generate("tilde collectors", sortScore(readData(scores, "&^%", headers)), *outPtr)
} }
type Table struct { type Table struct {