forked from browserpass/browserpass-native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
38 lines (30 loc) · 893 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"flag"
"fmt"
"os"
"github.com/browserpass/browserpass-native/openbsd"
"github.com/browserpass/browserpass-native/persistentlog"
"github.com/browserpass/browserpass-native/request"
"github.com/browserpass/browserpass-native/version"
log "github.com/sirupsen/logrus"
)
func main() {
var isVerbose bool
var isVersion bool
flag.BoolVar(&isVerbose, "v", false, "print verbose output")
flag.BoolVar(&isVersion, "version", false, "print version and exit")
flag.Parse()
if isVersion {
fmt.Println("Browserpass host app version:", version.String())
os.Exit(0)
}
openbsd.Pledge("stdio rpath proc exec getpw unix tty")
log.SetFormatter(&log.TextFormatter{FullTimestamp: true})
if isVerbose {
log.SetLevel(log.DebugLevel)
}
persistentlog.AddPersistentLogHook()
log.Debugf("Starting browserpass host app v%v", version.String())
request.Process()
}