forked from openshift/origin
/
openshift.go
63 lines (48 loc) · 1.59 KB
/
openshift.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package main
import (
"fmt"
"os"
kubeversion "github.com/GoogleCloudPlatform/kubernetes/pkg/version"
"github.com/spf13/cobra"
"github.com/openshift/origin/pkg/cmd/client"
"github.com/openshift/origin/pkg/cmd/flagtypes"
"github.com/openshift/origin/pkg/cmd/server"
"github.com/openshift/origin/pkg/version"
)
const longDescription = `
OpenShift for Admins
OpenShift helps you build, deploy, and manage your applications. To start an all-in-one server, run:
$ openshift start &
OpenShift is built around Docker and the Kubernetes cluster container manager. You must have
Docker installed on this machine to start your server.
Note: This is an alpha release of OpenShift and will change significantly. See
https://github.com/openshift/origin
for the latest information on OpenShift.
`
func main() {
openshiftCmd := &cobra.Command{
Use: "openshift",
Short: "OpenShift helps you build, deploy, and manage your applications",
Long: longDescription,
Run: func(c *cobra.Command, args []string) {
c.Help()
},
}
openshiftCmd.AddCommand(server.NewCommandStartServer("start"))
openshiftCmd.AddCommand(client.NewCommandKubecfg("kube"))
flagtypes.GLog(openshiftCmd.PersistentFlags())
// version information
versionCmd := &cobra.Command{
Use: "version",
Short: "Display version",
Run: func(c *cobra.Command, args []string) {
fmt.Printf("openshift %v\n", version.Get())
fmt.Printf("kubernetes %v\n", kubeversion.Get())
},
}
openshiftCmd.AddCommand(versionCmd)
if err := openshiftCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %s", err)
os.Exit(1)
}
}