Merge pull request #882 from hushan/cleanup_ps

cleanup ps.go
This commit is contained in:
Qiang Huang 2016-06-06 16:12:14 +08:00
commit 8e22b1d36b
1 changed files with 5 additions and 8 deletions

7
ps.go
View File

@ -30,11 +30,12 @@ var psCommand = cli.Command{
return err
}
if context.String("format") == "json" {
pids, err := container.Processes()
if err != nil {
return err
}
if context.String("format") == "json" {
if err := json.NewEncoder(os.Stdout).Encode(pids); err != nil {
return err
}
@ -57,10 +58,6 @@ var psCommand = cli.Command{
return err
}
pids, err := container.Processes()
if err != nil {
return err
}
fmt.Println(lines[0])
for _, line := range lines[1:] {
if len(line) == 0 {