Browse Source

Can't set `-f` as shortcut for `--follow` : conflict with `--file`

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 4 years ago
parent
commit
9d9dbf3a1f
2 changed files with 3 additions and 6 deletions
  1. 1 1
      cli/cmd/compose/logs.go
  2. 2 5
      local/compose/stop.go

+ 1 - 1
cli/cmd/compose/logs.go

@@ -46,7 +46,7 @@ func logsCommand(p *projectOptions, contextType string) *cobra.Command {
 			return runLogs(cmd.Context(), opts, args)
 			return runLogs(cmd.Context(), opts, args)
 		},
 		},
 	}
 	}
-	logsCmd.Flags().BoolVarP(&opts.follow, "follow", "f", false, "Follow log output.")
+	logsCmd.Flags().BoolVar(&opts.follow, "follow", false, "Follow log output.")
 	if contextType == store.DefaultContextType {
 	if contextType == store.DefaultContextType {
 		logsCmd.Flags().StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs for each container.")
 		logsCmd.Flags().StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs for each container.")
 	}
 	}

+ 2 - 5
local/compose/stop.go

@@ -26,7 +26,7 @@ import (
 	"github.com/docker/compose-cli/api/progress"
 	"github.com/docker/compose-cli/api/progress"
 )
 )
 
 
-func (s *composeService) Stop(ctx context.Context, project *types.Project, consumer compose.LogConsumer) error {
+func (s *composeService) Stop(ctx context.Context, project *types.Project) error {
 	w := progress.ContextWriter(ctx)
 	w := progress.ContextWriter(ctx)
 
 
 	var containers Containers
 	var containers Containers
@@ -39,9 +39,6 @@ func (s *composeService) Stop(ctx context.Context, project *types.Project, consu
 	}
 	}
 
 
 	return InReverseDependencyOrder(ctx, project, func(c context.Context, service types.ServiceConfig) error {
 	return InReverseDependencyOrder(ctx, project, func(c context.Context, service types.ServiceConfig) error {
-		serviceContainers, others := containers.split(isService(service.Name))
-		err := s.stopContainers(ctx, w, serviceContainers)
-		containers = others
-		return err
+		return s.stopContainers(ctx, w, containers.filter(isService(service.Name)))
 	})
 	})
 }
 }