From 46e3b2efb84580cc12b0bc5ad0863957b88ae202 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Tue, 31 Mar 2020 17:02:10 -0700 Subject: V2 podman inspect * Expose podman container inspect * Expose podman image inspect Signed-off-by: Jhon Honce --- cmd/podmanV2/common/inspect.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 cmd/podmanV2/common/inspect.go (limited to 'cmd/podmanV2/common') 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 +} -- cgit v1.2.3-54-g00ecf