/
describe_component.go
33 lines (28 loc) 路 1.04 KB
/
describe_component.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
33
package cmd
import (
e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
"github.com/spf13/cobra"
)
// describeComponentCmd describes configuration for components
var describeComponentCmd = &cobra.Command{
Use: "component",
Short: "Execute 'describe component' command",
Long: `This command shows configuration for an atmos component in a stack: atmos describe component <component> -s <stack>`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: true},
Run: func(cmd *cobra.Command, args []string) {
err := e.ExecuteDescribeComponent(cmd, args)
if err != nil {
u.PrintErrorToStdErrorAndExit(err)
}
},
}
func init() {
describeComponentCmd.DisableFlagParsing = false
describeComponentCmd.PersistentFlags().StringP("stack", "s", "", "atmos describe component <component> -s <stack>")
err := describeComponentCmd.MarkPersistentFlagRequired("stack")
if err != nil {
u.PrintErrorToStdErrorAndExit(err)
}
describeCmd.AddCommand(describeComponentCmd)
}