-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
describe_config.go
32 lines (28 loc) 路 929 Bytes
/
describe_config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package cmd
import (
"fmt"
e "github.com/cloudposse/atmos/internal/exec"
"github.com/fatih/color"
"github.com/spf13/cobra"
"os"
)
// describeComponentCmd describes configuration for components
var describeConfigCmd = &cobra.Command{
Use: "config",
Short: "Execute 'describe config' command",
Long: `This command shows the final (deep-merged) CLI configuration: atmos describe config`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
Run: func(cmd *cobra.Command, args []string) {
err := e.ExecuteDescribeConfig(cmd, args)
if err != nil {
color.Red("%s\n", err)
fmt.Println()
os.Exit(1)
}
},
}
func init() {
describeConfigCmd.DisableFlagParsing = false
describeConfigCmd.PersistentFlags().StringP("format", "f", "json", "'atmos describe config -f json' or 'atmos describe config -f yaml'")
describeCmd.AddCommand(describeConfigCmd)
}