review code about cmd/* and fix some easy typos :D

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
This commit is contained in:
Aaron.L.Xu 2017-02-10 15:35:05 +08:00
parent 0c71f36027
commit 0d8fd85842
1 changed files with 2 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"os" "os"
"strings"
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
"github.com/docker/docker/api/types/versions" "github.com/docker/docker/api/types/versions"
@ -17,7 +18,6 @@ import (
"github.com/docker/docker/pkg/term" "github.com/docker/docker/pkg/term"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
"strings"
) )
func newDockerCommand(dockerCli *command.DockerCli) *cobra.Command { func newDockerCommand(dockerCli *command.DockerCli) *cobra.Command {
@ -55,7 +55,7 @@ func newDockerCommand(dockerCli *command.DockerCli) *cobra.Command {
cli.SetupRootCommand(cmd) cli.SetupRootCommand(cmd)
cmd.SetHelpFunc(func(ccmd *cobra.Command, args []string) { cmd.SetHelpFunc(func(ccmd *cobra.Command, args []string) {
if dockerCli.Client() == nil { // when using --help, PersistenPreRun is not called, so initialization is needed. if dockerCli.Client() == nil { // when using --help, PersistentPreRun is not called, so initialization is needed.
// flags must be the top-level command flags, not cmd.Flags() // flags must be the top-level command flags, not cmd.Flags()
opts.Common.SetDefaultOptions(flags) opts.Common.SetDefaultOptions(flags)
dockerPreRun(opts) dockerPreRun(opts)