aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_pwd.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-04-03 00:20:00 -0700
committerChris Lu <chris.lu@gmail.com>2019-04-03 00:20:00 -0700
commit715a38da1e4fce05631f230ccf09ce92c99a4fd4 (patch)
treedc443bbe30b2178f24c67c19ef732013b8cabd0f /weed/shell/command_fs_pwd.go
parent20dcb44077bcb8164b8351ee506af8385e8fd6ef (diff)
downloadseaweedfs-715a38da1e4fce05631f230ccf09ce92c99a4fd4.tar.xz
seaweedfs-715a38da1e4fce05631f230ccf09ce92c99a4fd4.zip
weed shell: add fs.cd, fs.pwd to change to a directory and print current directory
Diffstat (limited to 'weed/shell/command_fs_pwd.go')
-rw-r--r--weed/shell/command_fs_pwd.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/weed/shell/command_fs_pwd.go b/weed/shell/command_fs_pwd.go
new file mode 100644
index 000000000..0b0a7f176
--- /dev/null
+++ b/weed/shell/command_fs_pwd.go
@@ -0,0 +1,32 @@
+package shell
+
+import (
+ "fmt"
+ "io"
+)
+
+func init() {
+ commands = append(commands, &commandFsPwd{})
+}
+
+type commandFsPwd struct {
+}
+
+func (c *commandFsPwd) Name() string {
+ return "fs.pwd"
+}
+
+func (c *commandFsPwd) Help() string {
+ return `print out current directory`
+}
+
+func (c *commandFsPwd) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
+
+ fmt.Fprintf(writer, "http://%s:%d%s\n",
+ commandEnv.option.FilerHost,
+ commandEnv.option.FilerPort,
+ commandEnv.option.Directory,
+ )
+
+ return nil
+}