github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/cmd/podman/inspect.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/hanks177/podman/v4/cmd/podman/common"
     5  	"github.com/hanks177/podman/v4/cmd/podman/inspect"
     6  	"github.com/hanks177/podman/v4/cmd/podman/registry"
     7  	"github.com/hanks177/podman/v4/pkg/domain/entities"
     8  	"github.com/spf13/cobra"
     9  )
    10  
    11  var (
    12  	inspectDescription = `Displays the low-level information on an object identified by name or ID.
    13    For more inspection options, see:
    14  
    15        podman container inspect
    16        podman image inspect
    17        podman network inspect
    18        podman pod inspect
    19        podman volume inspect`
    20  
    21  	// Command: podman _inspect_ Object_ID
    22  	inspectCmd = &cobra.Command{
    23  		Use:               "inspect [options] {CONTAINER|IMAGE|POD|NETWORK|VOLUME} [...]",
    24  		Short:             "Display the configuration of object denoted by ID",
    25  		RunE:              inspectExec,
    26  		Long:              inspectDescription,
    27  		TraverseChildren:  true,
    28  		ValidArgsFunction: common.AutocompleteInspect,
    29  		Example: `podman inspect fedora
    30    podman inspect --type image fedora
    31    podman inspect CtrID ImgID
    32    podman inspect --format "imageId: {{.Id}} size: {{.Size}}" fedora`,
    33  	}
    34  	inspectOpts *entities.InspectOptions
    35  )
    36  
    37  func init() {
    38  	registry.Commands = append(registry.Commands, registry.CliCommand{
    39  		Command: inspectCmd,
    40  	})
    41  	inspectOpts = inspect.AddInspectFlagSet(inspectCmd)
    42  }
    43  
    44  func inspectExec(cmd *cobra.Command, args []string) error {
    45  	return inspect.Inspect(args, *inspectOpts)
    46  }