forked from openshift/osdctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (26 loc) · 690 Bytes
/
main.go
File metadata and controls
33 lines (26 loc) · 690 Bytes
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
package main
import (
"flag"
"fmt"
"os"
"github.com/openshift/osdctl/cmd"
"github.com/spf13/pflag"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
func main() {
flags := pflag.NewFlagSet("osdctl", pflag.ExitOnError)
err := flag.CommandLine.Parse([]string{})
if err != nil {
fmt.Println("Error parsing commandline flags: ", err.Error())
return
}
pflag.CommandLine = flags
command := cmd.NewCmdRoot(genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr})
if err := command.Execute(); err != nil {
_, err := fmt.Fprintf(os.Stderr, "%v\n", err)
if err != nil {
fmt.Println("Error while printing to stderr: ", err.Error())
}
os.Exit(1)
}
}