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

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2021-01-27 10:46:16 +01:00
parent 163f3b9a89
commit 9d9dbf3a1f
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
2 changed files with 3 additions and 6 deletions

View File

@ -46,7 +46,7 @@ func logsCommand(p *projectOptions, contextType string) *cobra.Command {
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 {
logsCmd.Flags().StringVar(&opts.tail, "tail", "all", "Number of lines to show from the end of the logs for each container.")
}

View File

@ -26,7 +26,7 @@ import (
"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)
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 {
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)))
})
}