From 4a860ffa1af63d6ef9d39507361587c3c0014843 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 26 Jan 2015 00:29:07 -0500 Subject: [PATCH] -d flag for specifying directory to scan --- code.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/code.go b/code.go index 475b81d..d15b70a 100644 --- a/code.go +++ b/code.go @@ -4,18 +4,23 @@ import ( "os" "fmt" "time" + "flag" "bufio" "strings" "path/filepath" "text/template" ) -const ( - searchDir = "Code" -) +var searchDir string func main() { fmt.Println("Starting...") + + // Get any arguments + dirPtr := flag.String("d", "Code", "Directory to scan for each user.") + flag.Parse() + searchDir = *dirPtr + generate(findProjects()) }