cmd/explain.go
func ExplainCmd() *cobra.Command {
	var exo = &cli.ExplainOptions{}

	var cmd = &cobra.Command{
		Use:   "explain",
		Short: "Explain cluster",
		Long:  `Output expected and actual state of the given cluster`,
		Run: func(cmd *cobra.Command, args []string) {
			switch len(args) {
			case 0:
				exo.Name = viper.GetString(keyKubicornName)
			case 1:
				exo.Name = args[0]
			default:
				logger.Critical("Too many arguments.")
				os.Exit(1)
			}

			if err := runExplain(exo); err != nil {
				logger.Critical(err.Error())
				os.Exit(1)
			}
		},
	}

	fs := cmd.Flags()

	bindCommonStateStoreFlags(&exo.StateStoreOptions, fs)
	bindCommonAwsFlags(&exo.AwsOptions, fs)

	fs.StringVarP(&exo.Output, keyOutput, "o", viper.GetString(keyOutput), descOutput)
	fs.StringVar(&exo.GitRemote, keyGitConfig, viper.GetString(keyGitConfig), descGitConfig)

	return cmd
}
func ExplainCmd() *cobra.Command {
	var exo = &cli.ExplainOptions{}

	var cmd = &cobra.Command{
		Use:   "explain",
		Short: "Explain cluster",
		Long:  `Output expected and actual state of the given cluster`,
		Run: func(cmd *cobra.Command, args []string) {
			switch len(args) {
			case 0:
				exo.Name = viper.GetString(keyKubicornName)
			case 1:
				exo.Name = args[0]
			default:
				logger.Critical("Too many arguments.")
				os.Exit(1)
			}

			if err := runExplain(exo); err != nil {
				logger.Critical(err.Error())
				os.Exit(1)
			}
		},
	}

	fs := cmd.Flags()

	bindCommonStateStoreFlags(&exo.StateStoreOptions, fs)
	bindCommonAwsFlags(&exo.AwsOptions, fs)

	fs.StringVarP(&exo.Output, keyOutput, "o", viper.GetString(keyOutput), descOutput)
	fs.StringVar(&exo.GitRemote, keyGitConfig, viper.GetString(keyGitConfig), descGitConfig)

	return cmd
}
// ExplainCmd represents the explain command