diff options
Diffstat (limited to 'cmd/main.go')
-rw-r--r-- | cmd/main.go | 50 |
1 files changed, 49 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) } |