Skip to content

Commit

Permalink
Merge pull request moby#28029 from tealtail/27994-add-service-ls-trun…
Browse files Browse the repository at this point in the history
…cate-opt

remove COMMAND column from `service ls` output. closes moby#27994
  • Loading branch information
Misty Stanley-Jones authored Nov 7, 2016
2 parents 7a50218 + 1491ae5 commit 6780c31
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions command/service/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package service
import (
"fmt"
"io"
"strings"
"text/tabwriter"

"github.com/docker/docker/api/types"
Expand All @@ -18,7 +17,7 @@ import (
)

const (
listItemFmt = "%s\t%s\t%s\t%s\t%s\n"
listItemFmt = "%s\t%s\t%s\t%s\n"
)

type listOptions struct {
Expand Down Expand Up @@ -110,7 +109,7 @@ func printTable(out io.Writer, services []swarm.Service, running map[string]int)
// Ignore flushing errors
defer writer.Flush()

fmt.Fprintf(writer, listItemFmt, "ID", "NAME", "REPLICAS", "IMAGE", "COMMAND")
fmt.Fprintf(writer, listItemFmt, "ID", "NAME", "REPLICAS", "IMAGE")
for _, service := range services {
replicas := ""
if service.Spec.Mode.Replicated != nil && service.Spec.Mode.Replicated.Replicas != nil {
Expand All @@ -124,8 +123,7 @@ func printTable(out io.Writer, services []swarm.Service, running map[string]int)
stringid.TruncateID(service.ID),
service.Spec.Name,
replicas,
service.Spec.TaskTemplate.ContainerSpec.Image,
strings.Join(service.Spec.TaskTemplate.ContainerSpec.Args, " "))
service.Spec.TaskTemplate.ContainerSpec.Image)
}
}

Expand Down

0 comments on commit 6780c31

Please sign in to comment.