func BuildShowAppCmd()

in internal/pkg/cli/app_show.go [102:128]


func BuildShowAppCmd() *cobra.Command {
	opts := NewShowAppOpts()
	cmd := &cobra.Command{
		Use:   "show",
		Short: "Describe the application's deployed components",
		Long:  `Retrieves and displays the attributes of the infrastructure for the application defined in an Open Application Model application configuration file.`,
		Example: `
  Show the deployed application components, using an application configuration file:
	$ oam-ecs app show -f config.yml`,
		PreRunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			session, err := session.Default()
			if err != nil {
				return err
			}
			opts.ComponentDescriber = cloudformation.New(session)
			return nil
		}),
		RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			return opts.Execute()
		}),
	}

	cmd.Flags().StringVarP(&opts.OamFile, oamFileFlag, oamFileFlagShort, "", appConfigFileFlagDescription)
	cmd.MarkFlagRequired(oamFileFlag)

	return cmd
}