Skip to content

Commit

Permalink
update version cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny0826 committed Jan 17, 2020
1 parent 9d95a9f commit 5dfc79c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Available Commands:
version Prints the kubecm version

Flags:
--config string path of kubeconfig (default "$HOME/.kube/config")
-h, --help help for kubecm

Use "kubecm [command] --help" for more information about a command.
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Find more information at: https://github.com/sunny0826/kubecm
func (cli *Cli) setFlags() {
kubeconfig := flag.String("kubeconfig", filepath.Join(homeDir(), ".kube", "config"), "(optional) absolute path to the kubeconfig file")
flags := cli.rootCmd.PersistentFlags()
flags.StringVar(&cfgFile, "config", *kubeconfig, "config.yaml file (default is $HOME/.kubecm.yaml)")
flags.StringVar(&cfgFile, "config", *kubeconfig, "path of kubeconfig")
}

//Run command
Expand Down
7 changes: 4 additions & 3 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ type version struct {

func (vc *VersionCommand) Init() {
vc.command = &cobra.Command{
Use: "version",
Short: "Prints the kubecm version",
Example: "kubecm version",
Use: "version",
Short: "Print version info",
Long: "Print version info",
Aliases: []string{"v"},
Run: func(cmd *cobra.Command, args []string) {
cmd.Printf("Version: %s\n", getVersion().kubecmVersion)
cmd.Printf("GitCommit: %s\n", getVersion().GitCommit)
Expand Down

0 comments on commit 5dfc79c

Please sign in to comment.