Skip to content

Commit 03f4c0e

Browse files
authored
progress: make title configurable (docker#10507)
Signed-off-by: Guillaume Lours <[email protected]>
1 parent 2a0e83a commit 03f4c0e

File tree

12 files changed

+44
-35
lines changed

12 files changed

+44
-35
lines changed

pkg/compose/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ func (s *composeService) Build(ctx context.Context, project *types.Project, opti
4747
if err != nil {
4848
return err
4949
}
50-
return progress.Run(ctx, func(ctx context.Context) error {
50+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
5151
_, err := s.build(ctx, project, options)
5252
return err
53-
}, s.stderr())
53+
}, s.stderr(), "Building")
5454
}
5555

5656
//nolint:gocyclo

pkg/compose/cp.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ const (
4444
)
4545

4646
func (s *composeService) Copy(ctx context.Context, projectName string, options api.CopyOptions) error {
47-
return progress.Run(ctx, func(ctx context.Context) error {
47+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
4848
return s.copy(ctx, projectName, options)
49-
}, s.stderr())
49+
}, s.stderr(), "Copying")
5050
}
5151

5252
func (s *composeService) copy(ctx context.Context, projectName string, options api.CopyOptions) error {

pkg/compose/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ import (
4949
)
5050

5151
func (s *composeService) Create(ctx context.Context, project *types.Project, options api.CreateOptions) error {
52-
return progress.Run(ctx, func(ctx context.Context) error {
52+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
5353
return s.create(ctx, project, options)
54-
}, s.stderr())
54+
}, s.stderr(), "Creating")
5555
}
5656

5757
func (s *composeService) create(ctx context.Context, project *types.Project, options api.CreateOptions) error {

pkg/compose/kill.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import (
2929
)
3030

3131
func (s *composeService) Kill(ctx context.Context, projectName string, options api.KillOptions) error {
32-
return progress.Run(ctx, func(ctx context.Context) error {
32+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
3333
return s.kill(ctx, strings.ToLower(projectName), options)
34-
}, s.stderr())
34+
}, s.stderr(), "Killing")
3535
}
3636

3737
func (s *composeService) kill(ctx context.Context, projectName string, options api.KillOptions) error {

pkg/compose/pause.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ import (
2828
)
2929

3030
func (s *composeService) Pause(ctx context.Context, projectName string, options api.PauseOptions) error {
31-
return progress.Run(ctx, func(ctx context.Context) error {
31+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
3232
return s.pause(ctx, strings.ToLower(projectName), options)
33-
}, s.stderr())
33+
}, s.stderr(), "Pausing")
3434
}
3535

3636
func (s *composeService) pause(ctx context.Context, projectName string, options api.PauseOptions) error {

pkg/compose/pull.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ func (s *composeService) Pull(ctx context.Context, project *types.Project, optio
4242
if options.Quiet {
4343
return s.pull(ctx, project, options)
4444
}
45-
return progress.Run(ctx, func(ctx context.Context) error {
45+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
4646
return s.pull(ctx, project, options)
47-
}, s.stderr())
47+
}, s.stderr(), "Pulling")
4848
}
4949

5050
func (s *composeService) pull(ctx context.Context, project *types.Project, opts api.PullOptions) error { //nolint:gocyclo

pkg/compose/push.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ func (s *composeService) Push(ctx context.Context, project *types.Project, optio
4040
if options.Quiet {
4141
return s.push(ctx, project, options)
4242
}
43-
return progress.Run(ctx, func(ctx context.Context) error {
43+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
4444
return s.push(ctx, project, options)
45-
}, s.stderr())
45+
}, s.stderr(), "Pushing")
4646
}
4747

4848
func (s *composeService) push(ctx context.Context, project *types.Project, options api.PushOptions) error {

pkg/compose/remove.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ func (s *composeService) Remove(ctx context.Context, projectName string, options
9393
return nil
9494
}
9595
}
96-
return progress.Run(ctx, func(ctx context.Context) error {
96+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
9797
return s.remove(ctx, stoppedContainers, options)
98-
}, s.stderr())
98+
}, s.stderr(), "Removing")
9999
}
100100

101101
func (s *composeService) remove(ctx context.Context, containers Containers, options api.RemoveOptions) error {

pkg/compose/restart.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import (
2929
)
3030

3131
func (s *composeService) Restart(ctx context.Context, projectName string, options api.RestartOptions) error {
32-
return progress.Run(ctx, func(ctx context.Context) error {
32+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
3333
return s.restart(ctx, strings.ToLower(projectName), options)
34-
}, s.stderr())
34+
}, s.stderr(), "Restarting")
3535
}
3636

3737
func (s *composeService) restart(ctx context.Context, projectName string, options api.RestartOptions) error {

pkg/compose/stop.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626
)
2727

2828
func (s *composeService) Stop(ctx context.Context, projectName string, options api.StopOptions) error {
29-
return progress.Run(ctx, func(ctx context.Context) error {
29+
return progress.RunWithTitle(ctx, func(ctx context.Context) error {
3030
return s.stop(ctx, strings.ToLower(projectName), options)
31-
}, s.stderr())
31+
}, s.stderr(), "Stopping")
3232
}
3333

3434
func (s *composeService) stop(ctx context.Context, projectName string, options api.StopOptions) error {

0 commit comments

Comments
 (0)