mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-10 21:53:57 +08:00
Update cli package
The old one has bug when showing help message for IntFlags. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
@@ -52,17 +52,17 @@ in json format:
|
||||
Usage: "display only container IDs",
|
||||
},
|
||||
},
|
||||
Action: func(context *cli.Context) {
|
||||
Action: func(context *cli.Context) error {
|
||||
s, err := getContainers(context)
|
||||
if err != nil {
|
||||
fatal(err)
|
||||
return err
|
||||
}
|
||||
|
||||
if context.Bool("quiet") {
|
||||
for _, item := range s {
|
||||
fmt.Println(item.ID)
|
||||
}
|
||||
return
|
||||
return nil
|
||||
}
|
||||
|
||||
switch context.String("format") {
|
||||
@@ -78,15 +78,16 @@ in json format:
|
||||
item.Created.Format(time.RFC3339Nano))
|
||||
}
|
||||
if err := w.Flush(); err != nil {
|
||||
fatal(err)
|
||||
return err
|
||||
}
|
||||
case "json":
|
||||
if err := json.NewEncoder(os.Stdout).Encode(s); err != nil {
|
||||
fatal(err)
|
||||
return err
|
||||
}
|
||||
default:
|
||||
fatalf("invalid format option")
|
||||
return fmt.Errorf("invalid format option")
|
||||
}
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user