Merge pull request #99 from docker/feat-stop

Add `Stop` command on the gRPC side.
This commit is contained in:
Djordje Lukic 2020-05-18 07:40:39 -07:00 committed by GitHub
commit cf1be96833
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 577 additions and 372 deletions

View file

@ -15,6 +15,7 @@ import (
)
type psOpts struct {
all bool
quiet bool
}
@ -30,6 +31,7 @@ func PsCommand() *cobra.Command {
}
cmd.Flags().BoolVarP(&opts.quiet, "quiet", "q", false, "Only display IDs")
cmd.Flags().BoolVarP(&opts.all, "all", "a", false, "Show all containers (default shows just running)")
return cmd
}
@ -40,7 +42,7 @@ func runPs(ctx context.Context, opts psOpts) error {
return errors.Wrap(err, "cannot connect to backend")
}
containers, err := c.ContainerService().List(ctx)
containers, err := c.ContainerService().List(ctx, opts.all)
if err != nil {
return errors.Wrap(err, "fetch containers")
}