func HandleFlags() {
	RegisterCommonFlags(flag.CommandLine)
	RegisterClusterFlags(flag.CommandLine)
	flag.Parse()
}
HandleFlags sets up all flags and parses the command line.
package framework
import (
	"flag"
	"fmt"
	"io/ioutil"
	"os"
	"github.com/onsi/ginkgo/config"
	restclient "k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"
	clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
	"k8s.io/klog"
)
const (
	defaultHost = "http://127.0.0.1:8080"
)
type TestContextType struct {
	KubeConfig  string
	KubeContext string
	Host        string
	ReportDir    string
	ReportPrefix string
	DeleteNamespace          bool
	DeleteNamespaceOnFailure bool
	DumpLogsOnFailure bool
}
var TestContext TestContextType
func RegisterCommonFlags(flags *flag.FlagSet) {
	config.DefaultReporterConfig.Verbose = true
	config.GinkgoConfig.EmitSpecProgress = true
	config.GinkgoConfig.RandomizeAllSpecs = true
	flags.BoolVar(&TestContext.DumpLogsOnFailure, "dump-logs-on-failure", true, "If set to true test will dump data about the namespace in which test was running.")
	flags.BoolVar(&TestContext.DeleteNamespace, "delete-namespace", true, "If true tests will delete namespace after completion. It is only designed to make debugging easier, DO NOT turn it off by default.")
	flags.BoolVar(&TestContext.DeleteNamespaceOnFailure, "delete-namespace-on-failure", true, "If true, framework will delete test namespace on failure. Used only during test debugging.")
	flags.StringVar(&TestContext.Host, "host", "", fmt.Sprintf("The host, or apiserver, to connect to. Will default to %s if this argument and --kubeconfig are not set", defaultHost))
	flags.StringVar(&TestContext.ReportPrefix, "report-prefix", "", "Optional prefix for JUnit XML reports. Default is empty, which doesn't prepend anything to the default name.")
	flags.StringVar(&TestContext.ReportDir, "report-dir", "", "Path to the directory where the JUnit XML reports should be saved. Default is empty, which doesn't generate these reports.")
}
func RegisterClusterFlags(flags *flag.FlagSet) {
	flags.StringVar(&TestContext.KubeConfig, clientcmd.RecommendedConfigPathFlag, os.Getenv(clientcmd.RecommendedConfigPathEnvVar), "Path to kubeconfig containing embedded authinfo.")
	flags.StringVar(&TestContext.KubeContext, clientcmd.FlagContext, "", "kubeconfig context to use/override. If unset, will use value from 'current-context'")
}