do not split last column docker top
This commit is contained in:
parent
2a9c18af52
commit
fb4672c52c
3 changed files with 7 additions and 3 deletions
|
@ -682,7 +682,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
|
||||
}
|
||||
|
|
|
@ -728,7 +728,7 @@ to the newly created container.
|
|||
|
||||
::
|
||||
|
||||
Usage: docker top CONTAINER
|
||||
Usage: docker top CONTAINER [ps OPTIONS]
|
||||
|
||||
Lookup the running processes of a container
|
||||
|
||||
|
|
|
@ -350,7 +350,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