Add "json" as default value to format flag in all inspect commands.

Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Silvin Lubecki
2021-01-18 11:43:29 +01:00
committed by Sebastiaan van Stijn
parent c700bbcb4b
commit 84d47b544e
20 changed files with 64 additions and 21 deletions

View File

@ -8,6 +8,7 @@ import (
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/inspect"
flagsHelper "github.com/docker/cli/cli/flags"
"github.com/docker/docker/api/types"
apiclient "github.com/docker/docker/client"
"github.com/pkg/errors"
@ -36,7 +37,7 @@ func NewInspectCommand(dockerCli command.Cli) *cobra.Command {
}
flags := cmd.Flags()
flags.StringVarP(&opts.format, "format", "f", "", "Format the output using the given Go template")
flags.StringVarP(&opts.format, "format", "f", "json", flagsHelper.InspectFormatHelp)
flags.StringVar(&opts.inspectType, "type", "", "Return JSON for specified type")
flags.BoolVarP(&opts.size, "size", "s", false, "Display total file sizes if the type is container")