浏览代码

Fix checking -t flag

Signed-off-by: Debdut Chakraborty <[email protected]>
Debdut Chakraborty 4 年之前
父节点
当前提交
35b4d1de28
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      cmd/compose/down.go

+ 1 - 3
cmd/compose/down.go

@@ -43,10 +43,8 @@ func downCommand(p *projectOptions, backend api.Service) *cobra.Command {
 	downCmd := &cobra.Command{
 	downCmd := &cobra.Command{
 		Use:   "down",
 		Use:   "down",
 		Short: "Stop and remove containers, networks",
 		Short: "Stop and remove containers, networks",
-		PreRun: func(cmd *cobra.Command, args []string) {
+		PreRunE: AdaptCmd(func(ctx context.Context, cmd *cobra.Command, args []string) error {
 			opts.timeChanged = cmd.Flags().Changed("timeout")
 			opts.timeChanged = cmd.Flags().Changed("timeout")
-		},
-		PreRunE: Adapt(func(ctx context.Context, args []string) error {
 			if opts.images != "" {
 			if opts.images != "" {
 				if opts.images != "all" && opts.images != "local" {
 				if opts.images != "all" && opts.images != "local" {
 					return fmt.Errorf("invalid value for --rmi: %q", opts.images)
 					return fmt.Errorf("invalid value for --rmi: %q", opts.images)