mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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
3 changed files with 7 additions and 3 deletions
|
@ -683,7 +683,7 @@ func (cli *DockerCli) CmdInspect(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 {
|
||||
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
|
||||
|
||||
|
|
|
@ -416,7 +416,11 @@ func (srv *Server) ContainerTop(name, ps_args string) (*APITop, error) {
|
|||
}
|
||||
// no scanner.Text because we skip container id
|
||||
for scanner.Scan() {
|
||||
words = append(words, scanner.Text())
|
||||
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())
|
||||
}
|
||||
}
|
||||
if i == 0 {
|
||||
procs.Titles = words
|
||||
|
|
Loading…
Add table
Reference in a new issue