Merge pull request #879 from hqhq/list_use_cli_default
Use cli default value for list format
This commit is contained in:
commit
c0461277f9
6
list.go
6
list.go
|
@ -16,7 +16,7 @@ import (
|
||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
const formatOptions = `table(default) or json`
|
const formatOptions = `table or json`
|
||||||
|
|
||||||
// containerState represents the platform agnostic pieces relating to a
|
// containerState represents the platform agnostic pieces relating to a
|
||||||
// running container's status and state
|
// running container's status and state
|
||||||
|
@ -41,7 +41,7 @@ var listCommand = cli.Command{
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "format, f",
|
Name: "format, f",
|
||||||
Value: "",
|
Value: "table",
|
||||||
Usage: `select one of: ` + formatOptions,
|
Usage: `select one of: ` + formatOptions,
|
||||||
},
|
},
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
|
@ -63,7 +63,7 @@ var listCommand = cli.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
switch context.String("format") {
|
switch context.String("format") {
|
||||||
case "", "table":
|
case "table":
|
||||||
w := tabwriter.NewWriter(os.Stdout, 12, 1, 3, ' ', 0)
|
w := tabwriter.NewWriter(os.Stdout, 12, 1, 3, ' ', 0)
|
||||||
fmt.Fprint(w, "ID\tPID\tSTATUS\tBUNDLE\tCREATED\n")
|
fmt.Fprint(w, "ID\tPID\tSTATUS\tBUNDLE\tCREATED\n")
|
||||||
for _, item := range s {
|
for _, item := range s {
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
runc list [command options] [arguments...]
|
runc list [command options] [arguments...]
|
||||||
|
|
||||||
# OPTIONS
|
# OPTIONS
|
||||||
--format value, -f value select one of: table(default) or json
|
--format value, -f value select one of: table or json (default: "table")
|
||||||
--quiet, -q display only container IDs
|
--quiet, -q display only container IDs
|
||||||
|
|
Loading…
Reference in New Issue