From c446db21d30ca36e7ad91c24fffa005ad2af93c9 Mon Sep 17 00:00:00 2001 From: Albert Nigmatzianov Date: Sun, 28 May 2017 12:20:47 +0200 Subject: [PATCH] cmd: Delete projectBase flag It's redundant and it didn't work earlier anyway. --- cobra/cmd/root.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cobra/cmd/root.go b/cobra/cmd/root.go index cfc78522..1746b09c 100644 --- a/cobra/cmd/root.go +++ b/cobra/cmd/root.go @@ -23,7 +23,7 @@ import ( var ( // Used for flags. - cfgFile, projectBase, userLicense string + cfgFile, userLicense string rootCmd = &cobra.Command{ Use: "cobra", @@ -45,12 +45,10 @@ func init() { initViper() rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cobra.yaml)") - rootCmd.PersistentFlags().StringVarP(&projectBase, "projectbase", "b", "", "base project directory, e.g. github.com/spf13/") - rootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "Author name for copyright attribution") - rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "Name of license for the project (can provide `license` in config)") - rootCmd.PersistentFlags().Bool("viper", true, "Use Viper for configuration") + rootCmd.PersistentFlags().StringP("author", "a", "YOUR NAME", "author name for copyright attribution") + rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "name of license for the project (can provide `license` in config)") + rootCmd.PersistentFlags().Bool("viper", true, "use Viper for configuration") viper.BindPFlag("author", rootCmd.PersistentFlags().Lookup("author")) - viper.BindPFlag("projectbase", rootCmd.PersistentFlags().Lookup("projectbase")) viper.BindPFlag("useViper", rootCmd.PersistentFlags().Lookup("viper")) viper.SetDefault("author", "NAME HERE ") viper.SetDefault("license", "apache")