summaryrefslogtreecommitdiff
path: root/cmd/podmanV2/common
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-03-31 17:02:10 -0700
committerJhon Honce <jhonce@redhat.com>2020-04-01 08:07:43 -0700
commit46e3b2efb84580cc12b0bc5ad0863957b88ae202 (patch)
treedbe09731facf6a80406a62a6ca95b3f1514c2047 /cmd/podmanV2/common
parent82cbebcbea7f92be7e82bc11fdf1b30d7e194cdc (diff)
downloadpodman-46e3b2efb84580cc12b0bc5ad0863957b88ae202.tar.gz
podman-46e3b2efb84580cc12b0bc5ad0863957b88ae202.tar.bz2
podman-46e3b2efb84580cc12b0bc5ad0863957b88ae202.zip
V2 podman inspect
* Expose podman container inspect * Expose podman image inspect Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podmanV2/common')
-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
+}