-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.go
31 lines (26 loc) · 988 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
package main
import (
// Standard
"flag"
"fmt"
// Internal
"github.com/Ne0nd0g/merlin-cli/services/cli"
"github.com/Ne0nd0g/merlin-cli/version"
)
func main() {
addr := flag.String("addr", "127.0.0.1:50051", "The address of the Merlin server to connect to")
password := flag.String("password", "merlin", "the password to connect to the Merlin server")
secure := flag.Bool("secure", false, "Require server TLS certificate verification")
tlsKey := flag.String("tlsKey", "", "TLS private key file path")
tlsCert := flag.String("tlsCert", "", "TLS certificate file path")
tlsCA := flag.String("tlsCA", "", "TLS Certificate Authority file path")
v := flag.Bool("version", false, "Print the version number and exit")
flag.Parse()
if *v {
fmt.Printf("Merlin Version: %s, Build: %s\n", version.Version, version.Build)
return
}
// Start Merlin Command Line Interface
cliService := cli.NewCLIService(*password, *secure, *tlsKey, *tlsCert, *tlsCA)
cliService.Run(*addr)
}