aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-23 20:46:17 -0700
committerChris Lu <chris.lu@gmail.com>2020-03-23 20:46:17 -0700
commitd151185b7e5c7912afc38a36c163ef87eedcde3d (patch)
treed1ae92feac61c70596d9266b97b5aea792d3112f
parent40601953bfb6cfc0d27aee6d5ce07c69eccc48ca (diff)
downloadseaweedfs-d151185b7e5c7912afc38a36c163ef87eedcde3d.tar.xz
seaweedfs-d151185b7e5c7912afc38a36c163ef87eedcde3d.zip
shell: desupport filer url in the arguments
-rw-r--r--weed/shell/command_fs_cat.go1
-rw-r--r--weed/shell/command_fs_cd.go6
-rw-r--r--weed/shell/command_fs_du.go6
-rw-r--r--weed/shell/command_fs_ls.go3
-rw-r--r--weed/shell/command_fs_meta_cat.go2
-rw-r--r--weed/shell/command_fs_tree.go3
-rw-r--r--weed/shell/commands.go5
7 files changed, 11 insertions, 15 deletions
diff --git a/weed/shell/command_fs_cat.go b/weed/shell/command_fs_cat.go
index 1479aed95..b1d4eea14 100644
--- a/weed/shell/command_fs_cat.go
+++ b/weed/shell/command_fs_cat.go
@@ -25,7 +25,6 @@ func (c *commandFsCat) Help() string {
return `stream the file content on to the screen
fs.cat /dir/file_name
- fs.cat http://<filer_server>:<port>/dir/file_name
`
}
diff --git a/weed/shell/command_fs_cd.go b/weed/shell/command_fs_cd.go
index df42cd516..377fd40f7 100644
--- a/weed/shell/command_fs_cd.go
+++ b/weed/shell/command_fs_cd.go
@@ -16,14 +16,14 @@ func (c *commandFsCd) Name() string {
}
func (c *commandFsCd) Help() string {
- return `change directory to http://<filer_server>:<port>/dir/
+ return `change directory to a directory /path/to/dir
The full path can be too long to type. For example,
- fs.ls http://<filer_server>:<port>/some/path/to/file_name
+ fs.ls /some/path/to/file_name
can be simplified as
- fs.cd http://<filer_server>:<port>/some/path
+ fs.cd /some/path
fs.ls to/file_name
`
}
diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go
index b7313bebe..0372ba95f 100644
--- a/weed/shell/command_fs_du.go
+++ b/weed/shell/command_fs_du.go
@@ -24,9 +24,9 @@ func (c *commandFsDu) Name() string {
func (c *commandFsDu) Help() string {
return `show disk usage
- fs.du http://<filer_server>:<port>/dir
- fs.du http://<filer_server>:<port>/dir/file_name
- fs.du http://<filer_server>:<port>/dir/file_prefix
+ fs.du /dir
+ fs.du /dir/file_name
+ fs.du /dir/file_prefix
`
}
diff --git a/weed/shell/command_fs_ls.go b/weed/shell/command_fs_ls.go
index 4185d67a8..66adf057e 100644
--- a/weed/shell/command_fs_ls.go
+++ b/weed/shell/command_fs_ls.go
@@ -30,9 +30,6 @@ func (c *commandFsLs) Help() string {
fs.ls [-l] [-a] /dir/
fs.ls [-l] [-a] /dir/file_name
fs.ls [-l] [-a] /dir/file_prefix
- fs.ls [-l] [-a] http://<filer_server>:<port>/dir/
- fs.ls [-l] [-a] http://<filer_server>:<port>/dir/file_name
- fs.ls [-l] [-a] http://<filer_server>:<port>/dir/file_prefix
`
}
diff --git a/weed/shell/command_fs_meta_cat.go b/weed/shell/command_fs_meta_cat.go
index 9cbe852c0..cbbca746c 100644
--- a/weed/shell/command_fs_meta_cat.go
+++ b/weed/shell/command_fs_meta_cat.go
@@ -26,8 +26,6 @@ func (c *commandFsMetaCat) Help() string {
fs.meta.cat /dir/
fs.meta.cat /dir/file_name
- fs.meta.cat http://<filer_server>:<port>/dir/
- fs.meta.cat http://<filer_server>:<port>/dir/file_name
`
}
diff --git a/weed/shell/command_fs_tree.go b/weed/shell/command_fs_tree.go
index d1f639cff..0982082db 100644
--- a/weed/shell/command_fs_tree.go
+++ b/weed/shell/command_fs_tree.go
@@ -23,7 +23,8 @@ func (c *commandFsTree) Name() string {
func (c *commandFsTree) Help() string {
return `recursively list all files under a directory
- fs.tree http://<filer_server>:<port>/dir/
+ fs.tree /some/dir
+
`
}
diff --git a/weed/shell/commands.go b/weed/shell/commands.go
index 7ca631ab3..660929ec7 100644
--- a/weed/shell/commands.go
+++ b/weed/shell/commands.go
@@ -50,7 +50,8 @@ func NewCommandEnv(options ShellOptions) *CommandEnv {
func (ce *CommandEnv) parseUrl(input string) (filerServer string, filerPort int64, path string, err error) {
if strings.HasPrefix(input, "http") {
- return parseFilerUrl(input)
+ err = fmt.Errorf("http://<filer>:<port> prefix is not supported any more")
+ return
}
if !strings.HasPrefix(input, "/") {
input = filepath.ToSlash(filepath.Join(ce.option.Directory, input))
@@ -101,7 +102,7 @@ func parseFilerUrl(entryPath string) (filerServer string, filerPort int64, path
}
path = u.Path
} else {
- err = fmt.Errorf("path should have full url http://<filer_server>:<port>/path/to/dirOrFile : %s", entryPath)
+ err = fmt.Errorf("path should have full url /path/to/dirOrFile : %s", entryPath)
}
return
}