aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2016-07-21 15:00:07 -0700
committerChris Lu <chris.lu@gmail.com>2016-07-21 15:00:07 -0700
commit185a916f5eae022b89cc310d895fd93cac2fa3eb (patch)
tree8f02f047fb3ed8b97d52b03b111b2de1ebf8231f
parenta5be4a6d40dee779f390bd75c1d5480cd1167e22 (diff)
downloadseaweedfs-185a916f5eae022b89cc310d895fd93cac2fa3eb.tar.xz
seaweedfs-185a916f5eae022b89cc310d895fd93cac2fa3eb.zip
adjusting command options
-rw-r--r--weed/command/filer_copy.go (renamed from weed/command/copy.go)12
1 files changed, 6 insertions, 6 deletions
diff --git a/weed/command/copy.go b/weed/command/filer_copy.go
index 0e7109daf..2aa994f6f 100644
--- a/weed/command/copy.go
+++ b/weed/command/filer_copy.go
@@ -42,7 +42,7 @@ func init() {
}
var cmdCopy = &Command{
- UsageLine: "copy file_or_dir1 [file_or_dir2 file_or_dir3] http://localhost:8888/path/to/a/folder/",
+ UsageLine: "filer.copy file_or_dir1 [file_or_dir2 file_or_dir3] http://localhost:8888/path/to/a/folder/",
Short: "copy one or a list of files to a filer folder",
Long: `copy one or a list of files, or batch copy one whole folder recursively, to a filer folder
@@ -75,13 +75,13 @@ func runCopy(cmd *Command, args []string) bool {
fmt.Printf("The last argument should be a URL on filer: %v\n", err)
return false
}
- if len(fileOrDirs) > 1 && !strings.HasSuffix(filerUrl.Path, "/") {
- fmt.Println("Can not copy multiple items to a file. The last argument must be a folder ended with \"/\"")
- return false
+ path := filerUrl.Path
+ if !strings.HasSuffix(path, "/") {
+ path = path + "/"
}
for _, fileOrDir := range fileOrDirs {
- if !doEachCopy(fileOrDir, filerUrl.Host, filerUrl.Path) {
+ if !doEachCopy(fileOrDir, filerUrl.Host, path) {
return false
}
}
@@ -141,7 +141,7 @@ func doEachCopy(fileOrDir string, host string, path string) bool {
return false
}
- fmt.Printf("Copy %s => http://%s/%s\n", fileOrDir, host, path)
+ fmt.Printf("Copy %s => http://%s%s\n", fileOrDir, host, path)
return true
}