diff --git a/pkg/container/container.go b/pkg/container/container.go index 0f8cb738..3bdf46f2 100644 --- a/pkg/container/container.go +++ b/pkg/container/container.go @@ -13,10 +13,10 @@ import ( "github.com/sirupsen/logrus" ) -// GetContainer retrieves a container. If prompt is true and the retrievd count -// of containers does not match 1, then a prompt is presented to let the user -// choose. A count of 0 is handled gracefully. -func GetContainer(c context.Context, cl *client.Client, filters filters.Args, prompt bool) (types.Container, error) { +// GetContainer retrieves a container. If noInput is false and the retrievd +// count of containers does not match 1, then a prompt is presented to let the +// user choose. A count of 0 is handled gracefully. +func GetContainer(c context.Context, cl *client.Client, filters filters.Args, noInput bool) (types.Container, error) { containerOpts := types.ContainerListOptions{Filters: filters} containers, err := cl.ContainerList(c, containerOpts) if err != nil { @@ -37,7 +37,7 @@ func GetContainer(c context.Context, cl *client.Client, filters filters.Args, pr containersRaw = append(containersRaw, fmt.Sprintf("%s (created %v)", trimmed, created)) } - if !prompt { + if noInput { err := fmt.Errorf("expected 1 container but found %v: %s", len(containers), strings.Join(containersRaw, " ")) return types.Container{}, err }