From c0c1ccf23388bf5be370b6e2237937b1bd981877 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Sat, 31 Jan 2015 21:40:26 -0500 Subject: [PATCH] Test/develop mode with -t flag --- tablizer.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tablizer.go b/tablizer.go index af71354..c998fdd 100644 --- a/tablizer.go +++ b/tablizer.go @@ -12,8 +12,11 @@ import ( "text/template" ) +var ( + scoresPath = "/home/krowbar/Code/irc/tildescores.txt" +) + const ( - scores = "/home/krowbar/Code/irc/tildescores.txt" scoreDeltasPath = "/home/bear/scoredeltas.txt" deltaDelimiter = "+++" ) @@ -23,11 +26,16 @@ func main() { // Get any arguments outPtr := flag.String("o", "tildescores", "Output file name") + isTestPtr := flag.Bool("t", false, "Specifies we're developing") flag.Parse() + if *isTestPtr { + scoresPath = "/home/bear/tildescores.txt" + } + headers := []string{ "User", "Tildes", "Last Collected", "Last Amt.", "# Asks", "Avg." } - scoresData := readData(scores, "&^%") + scoresData := readData(scoresPath, "&^%") updatesData := readData(scoreDeltasPath, deltaDelimiter) scoresData = checkScoreDelta(scoresData, updatesData)