-
Notifications
You must be signed in to change notification settings - Fork 32
/
main.go
39 lines (30 loc) · 874 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
39
package main
import (
"log"
"os"
"github.com/urfave/cli"
"github.com/manifoldco/torus-cli/cmd"
"github.com/manifoldco/torus-cli/config"
"github.com/manifoldco/torus-cli/prefs"
"github.com/manifoldco/torus-cli/ui"
)
func main() {
cli.VersionPrinter = func(ctx *cli.Context) {
cmd.VersionLookup(ctx)
}
// For command line usage, we hide any log messages; our regular error
// flow will catch them. Logging is only used with the daemon.
log.SetOutput(devnull{})
preferences, _ := prefs.NewPreferences()
ui.Init(preferences)
app := cli.NewApp()
app.Name = "torus"
app.HelpName = "torus"
app.Usage = "A secure, shared workspace for secrets"
app.Version = config.Version
app.Commands = cmd.Cmds
app.Run(os.Args)
}
// devnull swallows up all log output.
type devnull struct{}
func (devnull) Write(p []byte) (n int, err error) { return len(p), nil }