diff options
Diffstat (limited to 'cmd/podman/images')
-rw-r--r-- | cmd/podman/images/build.go | 6 | ||||
-rw-r--r-- | cmd/podman/images/diff.go | 12 | ||||
-rw-r--r-- | cmd/podman/images/history.go | 7 | ||||
-rw-r--r-- | cmd/podman/images/import.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/inspect.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/list.go | 7 | ||||
-rw-r--r-- | cmd/podman/images/load.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/mount.go | 6 | ||||
-rw-r--r-- | cmd/podman/images/prune.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/pull.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/push.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/rm.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/save.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/search.go | 4 | ||||
-rw-r--r-- | cmd/podman/images/sign.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/tree.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/trust_set.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/trust_show.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/unmount.go | 2 |
19 files changed, 32 insertions, 36 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index ac1b2c848..18c31313b 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -40,7 +40,7 @@ var ( // Command: podman _diff_ Object_ID buildDescription = "Builds an OCI or Docker image using instructions from one or more Containerfiles and a specified build context directory." buildCmd = &cobra.Command{ - Use: "build [flags] [CONTEXT]", + Use: "build [options] [CONTEXT]", Short: "Build an image using instructions from Containerfiles", Long: buildDescription, Args: cobra.MaximumNArgs(1), @@ -282,8 +282,7 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil flags.Layers = false } - var stdin, stdout, stderr, reporter *os.File - stdin = os.Stdin + var stdout, stderr, reporter *os.File stdout = os.Stdout stderr = os.Stderr reporter = os.Stderr @@ -422,7 +421,6 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil ForceRmIntermediateCtrs: flags.ForceRm, IDMappingOptions: idmappingOptions, IIDFile: flags.Iidfile, - In: stdin, Isolation: isolation, Labels: flags.Label, Layers: flags.Layers, diff --git a/cmd/podman/images/diff.go b/cmd/podman/images/diff.go index 05a05fa04..b7722e5e5 100644 --- a/cmd/podman/images/diff.go +++ b/cmd/podman/images/diff.go @@ -1,9 +1,9 @@ package images import ( - "github.com/containers/podman/v2/cmd/podman/parse" + "github.com/containers/common/pkg/report" + "github.com/containers/podman/v2/cmd/podman/common" "github.com/containers/podman/v2/cmd/podman/registry" - "github.com/containers/podman/v2/cmd/podman/report" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -13,7 +13,7 @@ import ( var ( // podman container _inspect_ diffCmd = &cobra.Command{ - Use: "diff [flags] IMAGE", + Use: "diff [options] IMAGE", Args: cobra.ExactArgs(1), Short: "Inspect changes to the image's file systems", Long: `Displays changes to the image's filesystem. The image will be compared to its parent layer.`, @@ -51,10 +51,10 @@ func diff(cmd *cobra.Command, args []string) error { } switch { - case parse.MatchesJSONFormat(diffOpts.Format): - return report.ChangesToJSON(results) + case report.IsJSON(diffOpts.Format): + return common.ChangesToJSON(results) case diffOpts.Format == "": - return report.ChangesToTable(results) + return common.ChangesToTable(results) default: return errors.New("only supported value for '--format' is 'json'") } diff --git a/cmd/podman/images/history.go b/cmd/podman/images/history.go index fa4b368c6..3075218d1 100644 --- a/cmd/podman/images/history.go +++ b/cmd/podman/images/history.go @@ -10,9 +10,8 @@ import ( "time" "unicode" - "github.com/containers/podman/v2/cmd/podman/parse" + "github.com/containers/common/pkg/report" "github.com/containers/podman/v2/cmd/podman/registry" - "github.com/containers/podman/v2/cmd/podman/report" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/docker/go-units" "github.com/pkg/errors" @@ -27,7 +26,7 @@ var ( // podman _history_ historyCmd = &cobra.Command{ - Use: "history [flags] IMAGE", + Use: "history [options] IMAGE", Short: "Show history of a specified image", Long: long, Args: cobra.ExactArgs(1), @@ -81,7 +80,7 @@ func history(cmd *cobra.Command, args []string) error { return err } - if parse.MatchesJSONFormat(opts.format) { + if report.IsJSON(opts.format) { var err error if len(results.Layers) == 0 { _, err = fmt.Fprintf(os.Stdout, "[]\n") diff --git a/cmd/podman/images/import.go b/cmd/podman/images/import.go index 1c234e743..e3545da69 100644 --- a/cmd/podman/images/import.go +++ b/cmd/podman/images/import.go @@ -19,7 +19,7 @@ var ( Note remote tar balls can be specified, via web address. Optionally tag the image. You can specify the instructions using the --change option.` importCommand = &cobra.Command{ - Use: "import [flags] PATH [REFERENCE]", + Use: "import [options] PATH [REFERENCE]", Short: "Import a tarball to create a filesystem image", Long: importDescription, RunE: importCon, diff --git a/cmd/podman/images/inspect.go b/cmd/podman/images/inspect.go index 065dfaed2..8f005553d 100644 --- a/cmd/podman/images/inspect.go +++ b/cmd/podman/images/inspect.go @@ -10,7 +10,7 @@ import ( var ( // Command: podman image _inspect_ inspectCmd = &cobra.Command{ - Use: "inspect [flags] IMAGE [IMAGE...]", + Use: "inspect [options] IMAGE [IMAGE...]", Short: "Display the configuration of an image", Long: `Displays the low-level information of an image identified by name or ID.`, RunE: inspectExec, diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index 239da9d28..489b15086 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -10,10 +10,9 @@ import ( "time" "unicode" + "github.com/containers/common/pkg/report" "github.com/containers/image/v5/docker/reference" - "github.com/containers/podman/v2/cmd/podman/parse" "github.com/containers/podman/v2/cmd/podman/registry" - "github.com/containers/podman/v2/cmd/podman/report" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/docker/go-units" "github.com/pkg/errors" @@ -35,7 +34,7 @@ type listFlagType struct { var ( // Command: podman image _list_ listCmd = &cobra.Command{ - Use: "list [flags] [IMAGE]", + Use: "list [options] [IMAGE]", Aliases: []string{"ls"}, Args: cobra.MaximumNArgs(1), Short: "List images in local storage", @@ -108,7 +107,7 @@ func images(cmd *cobra.Command, args []string) error { switch { case listFlag.quiet: return writeID(imgs) - case parse.MatchesJSONFormat(listFlag.format): + case report.IsJSON(listFlag.format): return writeJSON(imgs) default: if cmd.Flag("format").Changed { diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go index cc8e71814..02f1b3b39 100644 --- a/cmd/podman/images/load.go +++ b/cmd/podman/images/load.go @@ -22,7 +22,7 @@ import ( var ( loadDescription = "Loads an image from a locally stored archive (tar file) into container storage." loadCommand = &cobra.Command{ - Use: "load [flags] [NAME[:TAG]]", + Use: "load [options] [NAME[:TAG]]", Short: "Load an image from container archive", Long: loadDescription, RunE: load, diff --git a/cmd/podman/images/mount.go b/cmd/podman/images/mount.go index 0a972ea81..28e9264ee 100644 --- a/cmd/podman/images/mount.go +++ b/cmd/podman/images/mount.go @@ -6,7 +6,7 @@ import ( "text/tabwriter" "text/template" - "github.com/containers/podman/v2/cmd/podman/parse" + "github.com/containers/common/pkg/report" "github.com/containers/podman/v2/cmd/podman/registry" "github.com/containers/podman/v2/cmd/podman/utils" "github.com/containers/podman/v2/pkg/domain/entities" @@ -24,7 +24,7 @@ var ( ` mountCommand = &cobra.Command{ - Use: "mount [flags] [IMAGE...]", + Use: "mount [options] [IMAGE...]", Short: "Mount an image's root filesystem", Long: mountDescription, RunE: mount, @@ -80,7 +80,7 @@ func mount(cmd *cobra.Command, args []string) error { } switch { - case parse.MatchesJSONFormat(mountOpts.Format): + case report.IsJSON(mountOpts.Format): return printJSON(reports) case mountOpts.Format == "": break // default format diff --git a/cmd/podman/images/prune.go b/cmd/podman/images/prune.go index 8dc203ead..b6e6b9562 100644 --- a/cmd/podman/images/prune.go +++ b/cmd/podman/images/prune.go @@ -19,7 +19,7 @@ var ( If an image is not being used by a container, it will be removed from the system.` pruneCmd = &cobra.Command{ - Use: "prune", + Use: "prune [options]", Args: validate.NoArgs, Short: "Remove unused images", Long: pruneDescription, diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go index 595a2165e..35ef80f3c 100644 --- a/cmd/podman/images/pull.go +++ b/cmd/podman/images/pull.go @@ -30,7 +30,7 @@ var ( // Command: podman pull pullCmd = &cobra.Command{ - Use: "pull [flags] IMAGE", + Use: "pull [options] IMAGE", Args: cobra.ExactArgs(1), Short: "Pull an image from a registry", Long: pullDescription, diff --git a/cmd/podman/images/push.go b/cmd/podman/images/push.go index 24192eccd..718bd4e8c 100644 --- a/cmd/podman/images/push.go +++ b/cmd/podman/images/push.go @@ -29,7 +29,7 @@ var ( // Command: podman push pushCmd = &cobra.Command{ - Use: "push [flags] SOURCE [DESTINATION]", + Use: "push [options] SOURCE [DESTINATION]", Short: "Push an image to a specified destination", Long: pushDescription, RunE: imagePush, diff --git a/cmd/podman/images/rm.go b/cmd/podman/images/rm.go index f6e52a49e..9dddef48f 100644 --- a/cmd/podman/images/rm.go +++ b/cmd/podman/images/rm.go @@ -14,7 +14,7 @@ import ( var ( rmDescription = "Removes one or more previously pulled or locally created images." rmCmd = &cobra.Command{ - Use: "rm [flags] IMAGE [IMAGE...]", + Use: "rm [options] IMAGE [IMAGE...]", Short: "Removes one or more images from local storage", Long: rmDescription, RunE: rm, diff --git a/cmd/podman/images/save.go b/cmd/podman/images/save.go index b164a2534..db1fa7159 100644 --- a/cmd/podman/images/save.go +++ b/cmd/podman/images/save.go @@ -25,7 +25,7 @@ var ( saveDescription = `Save an image to docker-archive or oci-archive on the local machine. Default is docker-archive.` saveCommand = &cobra.Command{ - Use: "save [flags] IMAGE [IMAGE...]", + Use: "save [options] IMAGE [IMAGE...]", Short: "Save image(s) to an archive", Long: saveDescription, RunE: save, diff --git a/cmd/podman/images/search.go b/cmd/podman/images/search.go index 8edd776ce..b1a1442a6 100644 --- a/cmd/podman/images/search.go +++ b/cmd/podman/images/search.go @@ -6,9 +6,9 @@ import ( "text/template" "github.com/containers/common/pkg/auth" + "github.com/containers/common/pkg/report" "github.com/containers/image/v5/types" "github.com/containers/podman/v2/cmd/podman/registry" - "github.com/containers/podman/v2/cmd/podman/report" "github.com/containers/podman/v2/pkg/domain/entities" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -32,7 +32,7 @@ var ( // Command: podman search searchCmd = &cobra.Command{ - Use: "search [flags] TERM", + Use: "search [options] TERM", Short: "Search registry for image", Long: searchDescription, RunE: imageSearch, diff --git a/cmd/podman/images/sign.go b/cmd/podman/images/sign.go index e331a64df..f6c1f9856 100644 --- a/cmd/podman/images/sign.go +++ b/cmd/podman/images/sign.go @@ -12,7 +12,7 @@ import ( var ( signDescription = "Create a signature file that can be used later to verify the image." signCommand = &cobra.Command{ - Use: "sign [flags] IMAGE [IMAGE...]", + Use: "sign [options] IMAGE [IMAGE...]", Short: "Sign an image", Long: signDescription, RunE: sign, diff --git a/cmd/podman/images/tree.go b/cmd/podman/images/tree.go index 0b79c2a4b..237a2ab91 100644 --- a/cmd/podman/images/tree.go +++ b/cmd/podman/images/tree.go @@ -11,7 +11,7 @@ import ( var ( treeDescription = "Prints layer hierarchy of an image in a tree format" treeCmd = &cobra.Command{ - Use: "tree [flags] IMAGE", + Use: "tree [options] IMAGE", Args: cobra.ExactArgs(1), Short: treeDescription, Long: treeDescription, diff --git a/cmd/podman/images/trust_set.go b/cmd/podman/images/trust_set.go index 878ffeea6..2e4b4fe17 100644 --- a/cmd/podman/images/trust_set.go +++ b/cmd/podman/images/trust_set.go @@ -12,7 +12,7 @@ import ( var ( setTrustDescription = "Set default trust policy or add a new trust policy for a registry" setTrustCommand = &cobra.Command{ - Use: "set [flags] REGISTRY", + Use: "set [options] REGISTRY", Short: "Set default trust policy or a new trust policy for a registry", Long: setTrustDescription, Example: "", diff --git a/cmd/podman/images/trust_show.go b/cmd/podman/images/trust_show.go index d1f85d34d..ba3b4e7fb 100644 --- a/cmd/podman/images/trust_show.go +++ b/cmd/podman/images/trust_show.go @@ -14,7 +14,7 @@ import ( var ( showTrustDescription = "Display trust policy for the system" showTrustCommand = &cobra.Command{ - Use: "show [flags] [REGISTRY]", + Use: "show [options] [REGISTRY]", Short: "Display trust policy for the system", Long: showTrustDescription, RunE: showTrust, diff --git a/cmd/podman/images/unmount.go b/cmd/podman/images/unmount.go index f7f6cf8e5..50dc972e8 100644 --- a/cmd/podman/images/unmount.go +++ b/cmd/podman/images/unmount.go @@ -19,7 +19,7 @@ var ( An unmount can be forced with the --force flag. ` unmountCommand = &cobra.Command{ - Use: "unmount [flags] IMAGE [IMAGE...]", + Use: "unmount [options] IMAGE [IMAGE...]", Aliases: []string{"umount"}, Short: "Unmount an image's root filesystem", Long: description, |