Browse Source

etcdctl: fix import typos

Barak Michener 10 years ago
parent
commit
ad7a12066f
1 changed files with 6 additions and 2 deletions
  1. 6 2
      etcdctl/command/import_snap_command.go

+ 6 - 2
etcdctl/command/import_snap_command.go

@@ -35,7 +35,11 @@ func NewImportSnapCommand() cli.Command {
 func handleImportSnap(c *cli.Context) {
 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 {
-		fmt.Printf("cannot read snapshot file %s\n", c.String("snap"))
+		if c.String("snap") == "" {
+			fmt.Printf("no snapshot file provided (use --snap)")
+		} else {
+			fmt.Printf("cannot read snapshot file %s\n", c.String("snap"))
+		}
 		os.Exit(1)
 		os.Exit(1)
 	}
 	}
 
 
@@ -90,7 +94,7 @@ func copyKeys(n *store.NodeExtern, setc chan set) int {
 		setc <- set{n.Key, *n.Value, n.TTL}
 		setc <- set{n.Key, *n.Value, n.TTL}
 		return 1
 		return 1
 	}
 	}
-	log.Println("entrying dir:", n.Key)
+	log.Println("entering dir:", n.Key)
 	for _, nn := range n.Nodes {
 	for _, nn := range n.Nodes {
 		sub := copyKeys(nn, setc)
 		sub := copyKeys(nn, setc)
 		num += sub
 		num += sub