Initial boilerplate: go dep, good logger, makefile (#2)

This commit is contained in:
Maxim Baz
2018-04-09 22:22:52 +02:00
committed by GitHub
parent c5aa13ab68
commit 7ee8736040
7 changed files with 137 additions and 0 deletions

32
main.go Normal file
View File

@@ -0,0 +1,32 @@
package main
import (
"flag"
"os"
log "github.com/sirupsen/logrus"
)
// VERSION host app version
const VERSION = "3.0.0"
func main() {
var verbose bool
var version bool
flag.BoolVar(&verbose, "v", false, "print verbose output")
flag.BoolVar(&version, "version", false, "print version and exit")
flag.Parse()
log.SetFormatter(&log.TextFormatter{FullTimestamp: true})
if verbose {
log.SetLevel(log.DebugLevel)
}
if version {
log.Info("Browserpass host app version: ", VERSION)
os.Exit(0)
}
log.Debugf("Starting browserpass host app v%v", VERSION)
process()
}