func buildSvcStopTaskCmd() *cobra.Command {
	vars := wkldStopTaskVars{}
	cmd := &cobra.Command{
		Use:   "stop-task",
		Short: "Stops tasks inside a service.",

		Example: `
  Stop task id "1234"' associated with "my-svc" service in "test" environment
  /code $ copilot svc stop-task --tasks <<taskArn>> -n my-svc -e test
  Stop all tasks associated with "my-svc" service
  /code $ copilot svc stop-task -n my-svc -e test --all`,
		RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			opts, err := newStopTaskOpts(vars)
			if err != nil {
				return err
			}
			if err := opts.Validate(); err != nil {
				return err
			}
			if err := opts.AskInput(); err != nil {
				return err
			}
			return opts.Execute()
		}),
	}
	cmd.Flags().StringVarP(&vars.name, nameFlag, nameFlagShort, "", svcFlagDescription)
	cmd.Flags().StringVarP(&vars.envName, envFlag, envFlagShort, "", envFlagDescription)
	cmd.Flags().StringVarP(&vars.appName, appFlag, appFlagShort, tryReadingAppName(), appFlagDescription)
	cmd.Flags().BoolVar(&vars.all, allFlag, false, allFlagDescription)
	cmd.Flags().StringSliceVar(&vars.taskIDs, tasksFlag, nil, tasksLogsFlagDescription)
	return cmd
}
// buildSvcStopTaskCmd builds the command for displaying service logs in an application.
buildSvcStopTaskCmd builds the command for displaying service logs in an application.
// buildSvcStopTaskCmd builds the command for displaying service logs in an application .
func buildSvcStopTaskCmd() *cobra.Command {
	vars := wkldStopTaskVars{}
	cmd := &cobra.Command{
		Use:   "stop-task",
		Short: "Stops tasks inside a service.",
		Example: `
  Stop task id "1234"' associated with "my-svc" service in "test" environment
  /code $ copilot svc stop-task --tasks <<taskArn>> -n my-svc -e test
  Stop all tasks associated with "my-svc" service
  /code $ copilot svc stop-task -n my-svc -e test --all`,
		RunE: runCmdE(func(cmd *cobra.Command, args []string) error {
			opts, err := newStopTaskOpts(vars)
			if err != nil {
				return err
			}
			if err := opts.Validate(); err != nil {
				return err
			}
			if err := opts.AskInput(); err != nil {
				return err
			}
			return opts.Execute()
		}),
	}
	cmd.Flags().StringVarP(&vars.name, nameFlag, nameFlagShort, "", svcFlagDescription)
	cmd.Flags().StringVarP(&vars.envName, envFlag, envFlagShort, "", envFlagDescription)
	cmd.Flags().StringVarP(&vars.appName, appFlag, appFlagShort, tryReadingAppName(), appFlagDescription)
	cmd.Flags().BoolVar(&vars.all, allFlag, false, allFlagDescription)
	cmd.Flags().StringSliceVar(&vars.taskIDs, tasksFlag, nil, tasksLogsFlagDescription)
	return cmd
}
func buildSvcStopTaskCmd ( ) * cobra . Command { vars := wkldStopTaskVars { } cmd := & cobra . Command { Use : " " , Short : " " , Example : `
  Stop task id "1234"' associated with "my-svc" service in "test" environment
  /code $ copilot svc stop-task --tasks <<taskArn>> -n my-svc -e test
  Stop all tasks associated with "my-svc" service
  /code $ copilot svc stop-task -n my-svc -e test --all` , RunE : runCmdE ( func ( cmd * cobra . Command , args [ ] string ) error { opts , err := newStopTaskOpts ( vars ) if err != nil { return err } if err := opts . Validate ( ) ; err != nil { return err } if err := opts . AskInput ( ) ; err != nil { return err } return opts . Execute ( ) } ) , } cmd . Flags ( ) . StringVarP ( & vars . name , nameFlag , nameFlagShort , " " , svcFlagDescription ) cmd . Flags ( ) . StringVarP ( & vars . envName , envFlag , envFlagShort , " " , envFlagDescription ) cmd . Flags ( ) . StringVarP ( & vars . appName , appFlag , appFlagShort , tryReadingAppName ( ) , appFlagDescription ) cmd . Flags ( ) . BoolVar ( & vars . all , allFlag , false , allFlagDescription ) cmd . Flags ( ) . StringSliceVar ( & vars . taskIDs , tasksFlag , nil , tasksLogsFlagDescription ) return cmd }
buildSvcStopTaskCmd builds the command for displaying service logs in an application.
buildSvcStopTaskCmd builds the command for displaying service logs in an application .