Browse Source

Merge pull request #2640 from xiang90/import

etcdctl: refactor message in import command
Xiang Li 10 years ago
parent
commit
c66777f80f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      etcdctl/command/import_snap_command.go

+ 2 - 2
etcdctl/command/import_snap_command.go

@@ -26,7 +26,7 @@ func NewImportSnapCommand() cli.Command {
 		Usage: "import a snapshot to a cluster",
 		Usage: "import a snapshot to a cluster",
 		Flags: []cli.Flag{
 		Flags: []cli.Flag{
 			cli.StringFlag{Name: "snap", Value: "", Usage: "Path to the vaild etcd 0.4.x snapshot."},
 			cli.StringFlag{Name: "snap", Value: "", Usage: "Path to the vaild etcd 0.4.x snapshot."},
-			cli.StringSliceFlag{Name: "hidden", Value: nil, Usage: "Hidden key space to import from snapshot"},
+			cli.StringSliceFlag{Name: "hidden", Value: new(cli.StringSlice), Usage: "Hidden key spaces to import from snapshot"},
 			cli.IntFlag{Name: "c", Value: 10, Usage: "Number of concurrent clients to import the data"},
 			cli.IntFlag{Name: "c", Value: 10, Usage: "Number of concurrent clients to import the data"},
 		},
 		},
 		Action: handleImportSnap,
 		Action: handleImportSnap,
@@ -37,7 +37,7 @@ func handleImportSnap(c *cli.Context) {
 	d, err := ioutil.ReadFile(c.String("snap"))
 	d, err := ioutil.ReadFile(c.String("snap"))
 	if err != nil {
 	if err != nil {
 		if c.String("snap") == "" {
 		if c.String("snap") == "" {
-			fmt.Printf("no snapshot file provided (use --snap)")
+			fmt.Printf("no snapshot file provided (use --snap)\n")
 		} else {
 		} else {
 			fmt.Printf("cannot read snapshot file %s\n", c.String("snap"))
 			fmt.Printf("cannot read snapshot file %s\n", c.String("snap"))
 		}
 		}