Update README.md, root.go, and 4 more files...

This commit is contained in:
up9-github
2021-04-21 17:35:08 +03:00
parent 4afd3ec9ac
commit baa33427ff
6 changed files with 336 additions and 35 deletions

View File

@@ -2,6 +2,7 @@ package cmd
import (
"github.com/spf13/cobra"
"github.com/up9inc/mizu/cli/config"
"github.com/up9inc/mizu/cli/mizu"
"regexp"
)
@@ -9,15 +10,6 @@ import (
// rootCmd represents the base command when called without any subcommands
var (
rootCmd = &cobra.Command{}
// TODO: bundle these up into a single config object, consider using viper for this
DisplayVersion bool
Quiet bool
NoDashboard bool
DashboardPort uint16
Namespace string
AllNamespaces bool
KubeConfigPath string
)
func init() {
rootCmd.Use = "cmd pod-query"
@@ -32,13 +24,13 @@ func init() {
return nil
}
rootCmd.Flags().BoolVarP(&DisplayVersion, "version", "v", false, "Print the version and exit")
rootCmd.Flags().BoolVarP(&Quiet, "quiet", "q", false, "No stdout output")
rootCmd.Flags().BoolVarP(&NoDashboard, "no-dashboard", "", false, "Dont host a dashboard")
rootCmd.Flags().Uint16VarP(&DashboardPort, "dashboard-port", "p", 3000, "Provide a custom port for the dashboard webserver")
rootCmd.Flags().StringVarP(&Namespace, "namespace", "n", "", "Namespace selector")
rootCmd.Flags().BoolVarP(&AllNamespaces, "all-namespaces", "A", false, "Select all namespaces")
rootCmd.Flags().StringVarP(&KubeConfigPath, "kubeconfig", "k", "", "Path to kubeconfig file")
rootCmd.Flags().BoolVarP(&config.Configuration.DisplayVersion, "version", "v", false, "Print the version and exit")
rootCmd.Flags().BoolVarP(&config.Configuration.Quiet, "quiet", "q", false, "No stdout output")
rootCmd.Flags().BoolVarP(&config.Configuration.NoDashboard, "no-dashboard", "", false, "Dont host a dashboard")
rootCmd.Flags().Uint16VarP(&config.Configuration.DashboardPort, "dashboard-port", "p", 3000, "Provide a custom port for the dashboard webserver")
rootCmd.Flags().StringVarP(&config.Configuration.Namespace, "namespace", "n", "", "Namespace selector")
rootCmd.Flags().BoolVarP(&config.Configuration.AllNamespaces, "all-namespaces", "A", false, "Select all namespaces")
rootCmd.Flags().StringVarP(&config.Configuration.KubeConfigPath, "kubeconfig", "k", "", "Path to kubeconfig file")
}
// Execute adds all child commands to the root command and sets flags appropriately.