|
1 | 1 | package main |
2 | 2 |
|
3 | 3 | import ( |
| 4 | +"fmt" |
4 | 5 | "os" |
5 | 6 |
|
6 | 7 | "github.com/isacikgoz/gitbatch/app" |
7 | | -log "github.com/sirupsen/logrus" |
8 | | -kingpin "gopkg.in/alecthomas/kingpin.v2" |
9 | | -) |
10 | | - |
11 | | -var ( |
12 | | -dirs = kingpin.Flag("directory", "Directory(s) to roam for git repositories.").Short('d').Strings() |
13 | | -mode = kingpin.Flag("mode", "Application start mode, more sensible with quick run.").Short('m').String() |
14 | | -recurseDepth = kingpin.Flag("recursive-depth", "Find directories recursively.").Default("0").Short('r').Int() |
15 | | -logLevel = kingpin.Flag("log-level", "Logging level; trace,debug,info,warn,error").Default("error").Short('l').String() |
16 | | -quick = kingpin.Flag("quick", "runs without gui and fetches/pull remote upstream.").Short('q').Bool() |
| 8 | +"gopkg.in/alecthomas/kingpin.v2" |
17 | 9 | ) |
18 | 10 |
|
19 | 11 | func main() { |
20 | | -kingpin.Version("gitbatch version 0.5.1") |
| 12 | +kingpin.Version("gitbatch version 0.5.2") |
| 13 | +dirs := kingpin.Flag("directory", "Directory(s) to roam for git repositories.").Short('d').Strings() |
| 14 | +mode := kingpin.Flag("mode", "Application start mode, more sensible with quick run.").Short('m').String() |
| 15 | +recursionDepth := kingpin.Flag("recursive-depth", "Find directories recursively.").Default("0").Short('r').Int() |
| 16 | +logLevel := kingpin.Flag("log-level", "Logging level; trace,debug,info,warn,error").Default("error").Short('l').String() |
| 17 | +quick := kingpin.Flag("quick", "runs without gui and fetches/pull remote upstream.").Short('q').Bool() |
21 | 18 |
|
22 | 19 | // parse the command line flag and options |
23 | 20 | kingpin.Parse() |
24 | 21 |
|
25 | | -if err := run(*dirs, *logLevel, *recurseDepth, *quick, *mode); err != nil { |
26 | | -log.WithFields(log.Fields{ |
27 | | -"error": err.Error(), |
28 | | -}).Error("application quitted with an unhandled error.") |
| 22 | +if err := run(*dirs, *logLevel, *recursionDepth, *quick, *mode); err != nil { |
| 23 | +fmt.Fprintf(os.Stderr, "application quitted with an unhandled error: %v", err) |
29 | 24 | os.Exit(1) |
30 | 25 | } |
31 | 26 | } |
|
0 commit comments