From 871b6928337440a692ee45a91f701fbceb3f41f4 Mon Sep 17 00:00:00 2001 From: allencloud Date: Sat, 8 Oct 2016 18:38:25 +0800 Subject: [PATCH] better prune and system df Signed-off-by: allencloud --- command/container/prune.go | 2 +- command/image/prune.go | 2 +- command/prune/prune.go | 12 ++++++------ command/system/df.go | 2 +- command/system/prune.go | 4 ++-- command/volume/prune.go | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/command/container/prune.go b/command/container/prune.go index 7088038614..be67fe4ca9 100644 --- a/command/container/prune.go +++ b/command/container/prune.go @@ -67,7 +67,7 @@ func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed u return } -// RunPrune call the Container Prune API +// RunPrune calls the Container Prune API // This returns the amount of space reclaimed and a detailed output string func RunPrune(dockerCli *command.DockerCli) (uint64, string, error) { return runPrune(dockerCli, pruneOptions{force: true}) diff --git a/command/image/prune.go b/command/image/prune.go index e5ad573130..46bd56cb10 100644 --- a/command/image/prune.go +++ b/command/image/prune.go @@ -83,7 +83,7 @@ func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed u return } -// RunPrune call the Image Prune API +// RunPrune calls the Image Prune API // This returns the amount of space reclaimed and a detailed output string func RunPrune(dockerCli *command.DockerCli, all bool) (uint64, string, error) { return runPrune(dockerCli, pruneOptions{force: true, all: all}) diff --git a/command/prune/prune.go b/command/prune/prune.go index 0b1374eda9..fd04c590b6 100644 --- a/command/prune/prune.go +++ b/command/prune/prune.go @@ -8,32 +8,32 @@ import ( "github.com/spf13/cobra" ) -// NewContainerPruneCommand return a cobra prune command for containers +// NewContainerPruneCommand returns a cobra prune command for containers func NewContainerPruneCommand(dockerCli *command.DockerCli) *cobra.Command { return container.NewPruneCommand(dockerCli) } -// NewVolumePruneCommand return a cobra prune command for volumes +// NewVolumePruneCommand returns a cobra prune command for volumes func NewVolumePruneCommand(dockerCli *command.DockerCli) *cobra.Command { return volume.NewPruneCommand(dockerCli) } -// NewImagePruneCommand return a cobra prune command for images +// NewImagePruneCommand returns a cobra prune command for images func NewImagePruneCommand(dockerCli *command.DockerCli) *cobra.Command { return image.NewPruneCommand(dockerCli) } -// RunContainerPrune execute a prune command for containers +// RunContainerPrune executes a prune command for containers func RunContainerPrune(dockerCli *command.DockerCli) (uint64, string, error) { return container.RunPrune(dockerCli) } -// RunVolumePrune execute a prune command for volumes +// RunVolumePrune executes a prune command for volumes func RunVolumePrune(dockerCli *command.DockerCli) (uint64, string, error) { return volume.RunPrune(dockerCli) } -// RunImagePrune execute a prune command for images +// RunImagePrune executes a prune command for images func RunImagePrune(dockerCli *command.DockerCli, all bool) (uint64, string, error) { return image.RunPrune(dockerCli, all) } diff --git a/command/system/df.go b/command/system/df.go index 085d680fe8..293946c188 100644 --- a/command/system/df.go +++ b/command/system/df.go @@ -19,7 +19,7 @@ func NewDiskUsageCommand(dockerCli *command.DockerCli) *cobra.Command { cmd := &cobra.Command{ Use: "df [OPTIONS]", Short: "Show docker disk usage", - Args: cli.RequiresMaxArgs(1), + Args: cli.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return runDiskUsage(dockerCli, opts) }, diff --git a/command/system/prune.go b/command/system/prune.go index 6a36fdd890..ea8a41380f 100644 --- a/command/system/prune.go +++ b/command/system/prune.go @@ -15,13 +15,13 @@ type pruneOptions struct { all bool } -// NewPruneCommand creates a new cobra.Command for `docker du` +// NewPruneCommand creates a new cobra.Command for `docker prune` func NewPruneCommand(dockerCli *command.DockerCli) *cobra.Command { var opts pruneOptions cmd := &cobra.Command{ Use: "prune [OPTIONS]", - Short: "Remove unused data.", + Short: "Remove unused data", Args: cli.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return runPrune(dockerCli, opts) diff --git a/command/volume/prune.go b/command/volume/prune.go index dc2d3e25bc..a4bb0092d6 100644 --- a/command/volume/prune.go +++ b/command/volume/prune.go @@ -67,7 +67,7 @@ func runPrune(dockerCli *command.DockerCli, opts pruneOptions) (spaceReclaimed u return } -// RunPrune call the Volume Prune API +// RunPrune calls the Volume Prune API // This returns the amount of space reclaimed and a detailed output string func RunPrune(dockerCli *command.DockerCli) (uint64, string, error) { return runPrune(dockerCli, pruneOptions{force: true})