github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/cmd/podmanV2/volumes/volume.go (about) 1 package volumes 2 3 import ( 4 "github.com/containers/libpod/cmd/podmanV2/registry" 5 "github.com/containers/libpod/pkg/domain/entities" 6 "github.com/spf13/cobra" 7 ) 8 9 var ( 10 // Command: podman _volume_ 11 volumeCmd = &cobra.Command{ 12 Use: "volume", 13 Short: "Manage volumes", 14 Long: "Volumes are created in and can be shared between containers", 15 TraverseChildren: true, 16 PersistentPreRunE: preRunE, 17 RunE: registry.SubCommandExists, 18 } 19 ) 20 21 func init() { 22 registry.Commands = append(registry.Commands, registry.CliCommand{ 23 Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, 24 Command: volumeCmd, 25 }) 26 volumeCmd.SetHelpTemplate(registry.HelpTemplate()) 27 volumeCmd.SetUsageTemplate(registry.UsageTemplate()) 28 } 29 30 func preRunE(cmd *cobra.Command, args []string) error { 31 _, err := registry.NewContainerEngine(cmd, args) 32 return err 33 }