Skip to content

Commit

Permalink
change since, until
Browse files Browse the repository at this point in the history
  • Loading branch information
khw7096 committed Mar 31, 2019
1 parent 63492e9 commit 79b03b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ $ git hours -author woong
$ git hours -author woong,kybin
```

### timezone offset value
사용자가 이용하는 타임존 시간을 인식하고 기본값으로 사용합니다.
```
$ git hours -zone +0900
```

### debug mode
```
$ git hours -debug
Expand Down
15 changes: 2 additions & 13 deletions git-hours.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,13 @@ func main() {
sincePtr := flag.String("since", since, "since(after) date")
untilPtr := flag.String("until", until, "until(before) date")
authorPtr := flag.String("author", "", "author name") // git option : --author="\(Adam\)\|\(Jon\)"
zonePtr := flag.String("zone", initZone, "zone offset time")
debugPtr := flag.Bool("debug", false, "debug mode")
helpPtr := flag.Bool("help", false, "print help")
flag.Parse()
if *helpPtr {
flag.PrintDefaults()
os.Exit(0)
}
if !timeFormat.MatchString(*sincePtr) {
fmt.Println("not matching since date format. must be " + DTF)
flag.PrintDefaults()
os.Exit(1)
}
if !timeFormat.MatchString(*untilPtr) {
fmt.Println("not matching until date format. must be " + DTF)
flag.PrintDefaults()
os.Exit(1)
}
//checkMultiname
var author string
if strings.Contains(*authorPtr, ",") {
Expand All @@ -95,8 +84,8 @@ func main() {
"--date=iso",
`--pretty=format:%ad %an %s`,
fmt.Sprintf(`--author=%s`, author),
fmt.Sprintf(`--after="%s 00:00:00 %s"`, *sincePtr, *zonePtr),
fmt.Sprintf(`--before="%s 23:59:59 %s"`, *untilPtr, *zonePtr),
fmt.Sprintf(`--since="%s"`, *sincePtr),
fmt.Sprintf(`--until="%s"`, *untilPtr),
)
var stdout bytes.Buffer
var stderr bytes.Buffer
Expand Down

0 comments on commit 79b03b7

Please sign in to comment.