Skip to content

Commit

Permalink
Merge pull request kamijin-fanta#1 from yuuki/master
Browse files Browse the repository at this point in the history
Allow to specify any garoon user ID
  • Loading branch information
kamijin-fanta authored Nov 12, 2020
2 parents 6a35734 + 7b3a5a9 commit 76e469d
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ package main

import (
"fmt"
"os"
"regexp"
"strings"
"time"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/joho/godotenv"
"github.com/otoyo/garoon"
"github.com/urfave/cli/v2"
"google.golang.org/api/calendar/v3"
"os"
"regexp"
"strings"
"time"
)

func main() {
Expand All @@ -26,6 +27,11 @@ func main() {
EnvVars: []string{"GAROON_USER"},
Required: true,
},
&cli.StringFlag{
Name: "grn-user-id",
Usage: "garoon target user id",
EnvVars: []string{"GAROON_USER_ID"},
},
&cli.StringFlag{
Name: "grn-pass",
Usage: "garoon login password",
Expand Down Expand Up @@ -68,8 +74,7 @@ func main() {
{
Name: "sync",
Usage: "sync",
Flags: []cli.Flag{
},
Flags: []cli.Flag{},
Action: func(c *cli.Context) error {
grnUrl := c.String("grn-url")
var client *garoon.Client
Expand Down Expand Up @@ -111,7 +116,7 @@ func main() {
// panic(err)
//}

grnEvents, err := grn.EventsByUser(start, end, "661")
grnEvents, err := grn.EventsByUser(start, end, c.String("grn-user-id"))
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 76e469d

Please sign in to comment.