forked from openshift/pivot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
36 lines (30 loc) · 719 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
package main
import (
"flag"
"fmt"
"os"
"github.com/openshift/pivot/cmd"
"github.com/spf13/pflag"
)
// The following are passed in at build time
var commitHash string
var version string
// showHeader generates and prints the program header line
func showHeader() {
header := fmt.Sprintf("pivot version %s", version)
// If we have a commit hash then add it to the program header
if commitHash != "" {
header = fmt.Sprintf("%s (%s)", header, commitHash)
}
fmt.Println(header)
}
// main is the entry point for the command
func main() {
showHeader()
flag.CommandLine.Parse([]string{})
pflag.Set("logtostderr", "true")
if err := cmd.RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}