summaryrefslogtreecommitdiff
path: root/cmd/podmanV2/common/inspect.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-04-01 19:08:08 +0200
committerGitHub <noreply@github.com>2020-04-01 19:08:08 +0200
commitd534e524272121a6489c1a2a2c11c6b389027ecd (patch)
treedbe09731facf6a80406a62a6ca95b3f1514c2047 /cmd/podmanV2/common/inspect.go
parent82cbebcbea7f92be7e82bc11fdf1b30d7e194cdc (diff)
parent46e3b2efb84580cc12b0bc5ad0863957b88ae202 (diff)
downloadpodman-d534e524272121a6489c1a2a2c11c6b389027ecd.tar.gz
podman-d534e524272121a6489c1a2a2c11c6b389027ecd.tar.bz2
podman-d534e524272121a6489c1a2a2c11c6b389027ecd.zip
Merge pull request #5645 from jwhonce/wip/inspect
V2 podman inspect
Diffstat (limited to 'cmd/podmanV2/common/inspect.go')
-rw-r--r--cmd/podmanV2/common/inspect.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmd/podmanV2/common/inspect.go b/cmd/podmanV2/common/inspect.go
new file mode 100644
index 000000000..dfc6fe679
--- /dev/null
+++ b/cmd/podmanV2/common/inspect.go
@@ -0,0 +1,18 @@
+package common
+
+import (
+ "github.com/containers/libpod/pkg/domain/entities"
+ "github.com/spf13/cobra"
+)
+
+// AddInspectFlagSet takes a command and adds the inspect flags and returns an InspectOptions object
+// Since this cannot live in `package main` it lives here until a better home is found
+func AddInspectFlagSet(cmd *cobra.Command) *entities.InspectOptions {
+ opts := entities.InspectOptions{}
+
+ flags := cmd.Flags()
+ flags.BoolVarP(&opts.Size, "size", "s", false, "Display total file size")
+ flags.StringVarP(&opts.Format, "format", "f", "", "Change the output format to a Go template")
+
+ return &opts
+}