diff options
Diffstat (limited to '')
-rw-r--r-- | cmd/main.go | 50 | ||||
-rw-r--r-- | go.mod | 1 |
2 files changed, 50 insertions, 1 deletions
diff --git a/cmd/main.go b/cmd/main.go index 477cc47..21ddd17 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -4,9 +4,12 @@ datamaps-go is a simple tool to extract from and send data to spreadsheets. package main import ( + "fmt" "log" "os" "path/filepath" + + "github.com/urfave/cli/v2" ) func setUp() (string, error) { @@ -42,7 +45,52 @@ func setUp() (string, error) { // Entry point func main() { - _, err := setUp() + app := &cli.App{ + Flags: []cli.Flag{ + &cli.StringFlag{ + Name: "datamap, dm", + Aliases: []string{"dm"}, + Value: "/home/lemon/Documents/datamaps/input/datamap.csv", + Usage: "Path to a datamap file", + }, + &cli.StringFlag{ + Name: "master, m", + Aliases: []string{"m"}, + Value: "/home/lemon/Documents/datamaps/input/master.xlsx", + Usage: "Path to a master file", + }, + }, + Commands: []*cli.Command{ + { + Name: "import", + Aliases: []string{"i"}, + Usage: "Import a bunch of populated templates", + Action: func(c *cli.Context) error { + return nil + }, + }, + { + Name: "export", + Aliases: []string{"e"}, + Usage: "Export a master to populate blank templates", + Action: func(c *cli.Context) error { + return nil + }, + }, + }, + Name: "datamaps", + Usage: "Import and export data to and from spreadsheets", + Action: func(c *cli.Context) error { + fmt.Println("DATAMAPS") + return nil + }, + } + + err := app.Run(os.Args) + if err != nil { + log.Fatal(err) + } + _, err = setUp() if err != nil { log.Fatal(err) } @@ -5,5 +5,6 @@ go 1.14 require ( github.com/mattn/go-sqlite3 v1.14.0 github.com/tealeg/xlsx v1.0.5 + github.com/urfave/cli/v2 v2.2.0 github.com/yulqen/coords v0.1.0 ) |