2016-04-19 12:59:48 -04:00
|
|
|
package volume
|
|
|
|
|
|
|
|
import (
|
2016-05-16 17:20:29 -04:00
|
|
|
"fmt"
|
|
|
|
|
2016-04-19 12:59:48 -04:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
|
|
|
"github.com/docker/docker/api/client"
|
2016-05-16 17:20:29 -04:00
|
|
|
"github.com/docker/docker/cli"
|
2016-04-19 12:59:48 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// NewVolumeCommand returns a cobra command for `volume` subcommands
|
|
|
|
func NewVolumeCommand(dockerCli *client.DockerCli) *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
|
|
|
Use: "volume",
|
|
|
|
Short: "Manage Docker volumes",
|
2016-05-26 17:57:31 -04:00
|
|
|
Args: cli.NoArgs,
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
fmt.Fprintf(dockerCli.Err(), "\n"+cmd.UsageString())
|
2016-05-16 17:20:29 -04:00
|
|
|
},
|
2016-04-19 12:59:48 -04:00
|
|
|
}
|
|
|
|
cmd.AddCommand(
|
|
|
|
newCreateCommand(dockerCli),
|
|
|
|
newInspectCommand(dockerCli),
|
|
|
|
newListCommand(dockerCli),
|
|
|
|
newRemoveCommand(dockerCli),
|
|
|
|
)
|
|
|
|
return cmd
|
|
|
|
}
|