aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_cat.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-23 21:26:15 -0700
committerChris Lu <chris.lu@gmail.com>2020-03-23 21:26:15 -0700
commite666aeece2778812a4a9d3fc4daaaac86fe4a412 (patch)
treeb2554056e1398869fe3250af00bdd7f1fa3f6458 /weed/shell/command_fs_cat.go
parentd151185b7e5c7912afc38a36c163ef87eedcde3d (diff)
downloadseaweedfs-e666aeece2778812a4a9d3fc4daaaac86fe4a412.tar.xz
seaweedfs-e666aeece2778812a4a9d3fc4daaaac86fe4a412.zip
simplify parsing filer host and port
Diffstat (limited to 'weed/shell/command_fs_cat.go')
-rw-r--r--weed/shell/command_fs_cat.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/weed/shell/command_fs_cat.go b/weed/shell/command_fs_cat.go
index b1d4eea14..7177d8ac3 100644
--- a/weed/shell/command_fs_cat.go
+++ b/weed/shell/command_fs_cat.go
@@ -30,20 +30,18 @@ func (c *commandFsCat) Help() string {
func (c *commandFsCat) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
- input := findInputDirectory(args)
-
- filerServer, filerPort, path, err := commandEnv.parseUrl(input)
+ path, err := commandEnv.parseUrl(findInputDirectory(args))
if err != nil {
return err
}
- if commandEnv.isDirectory(filerServer, filerPort, path) {
+ if commandEnv.isDirectory(path) {
return fmt.Errorf("%s is a directory", path)
}
dir, name := util.FullPath(path).DirAndName()
- return commandEnv.withFilerClient(filerServer, filerPort, func(client filer_pb.SeaweedFilerClient) error {
+ return commandEnv.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
request := &filer_pb.LookupDirectoryEntryRequest{
Name: name,