cmd/list.go
func ListCmd() *cobra.Command {
	var lo = &cli.ListOptions{}
	var cmd = &cobra.Command{
		Use:   "list",
		Short: "List available states",
		Long:  `List the states available in the _state directory`,
		Run: func(cmd *cobra.Command, args []string) {
			if err := runList(lo); err != nil {
				logger.Critical(err.Error())
				os.Exit(1)
			}
		},
	}

	fs := cmd.Flags()

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

	fs.BoolVarP(&noHeaders, keyNoHeaders, "n", viper.GetBool(keyNoHeaders), desNoHeaders)

	return cmd
}
func ListCmd() *cobra.Command {
	var lo = &cli.ListOptions{}
	var cmd = &cobra.Command{
		Use:   "list",
		Short: "List available states",
		Long:  `List the states available in the _state directory`,
		Run: func(cmd *cobra.Command, args []string) {
			if err := runList(lo); err != nil {
				logger.Critical(err.Error())
				os.Exit(1)
			}
		},
	}

	fs := cmd.Flags()

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

	fs.BoolVarP(&noHeaders, keyNoHeaders, "n", viper.GetBool(keyNoHeaders), desNoHeaders)

	return cmd
}
// ListCmd represents the list command