Merge pull request #2457 from dotcloud/2454_do_not_split_last_column
RemoteAPI: Do not split last column docker top
This commit is contained in:
commit
8f27e23b4b
|
@ -683,7 +683,7 @@ func (cli *DockerCli) CmdInspect(args ...string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cli *DockerCli) CmdTop(args ...string) error {
|
func (cli *DockerCli) CmdTop(args ...string) error {
|
||||||
cmd := Subcmd("top", "CONTAINER", "Lookup the running processes of a container")
|
cmd := Subcmd("top", "CONTAINER [ps OPTIONS]", "Lookup the running processes of a container")
|
||||||
if err := cmd.Parse(args); err != nil {
|
if err := cmd.Parse(args); err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -729,7 +729,7 @@ The main process inside the container will receive SIGTERM, and after a grace pe
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
Usage: docker top CONTAINER
|
Usage: docker top CONTAINER [ps OPTIONS]
|
||||||
|
|
||||||
Lookup the running processes of a container
|
Lookup the running processes of a container
|
||||||
|
|
||||||
|
|
|
@ -416,8 +416,12 @@ func (srv *Server) ContainerTop(name, ps_args string) (*APITop, error) {
|
||||||
}
|
}
|
||||||
// no scanner.Text because we skip container id
|
// no scanner.Text because we skip container id
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
|
if i != 0 && len(words) == len(procs.Titles) {
|
||||||
|
words[len(words)-1] = fmt.Sprintf("%s %s", words[len(words)-1], scanner.Text())
|
||||||
|
} else {
|
||||||
words = append(words, scanner.Text())
|
words = append(words, scanner.Text())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if i == 0 {
|
if i == 0 {
|
||||||
procs.Titles = words
|
procs.Titles = words
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue