aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_fs_pwd.go
blob: 65ce3fe7d6e359d335ade8ecb06fd37dd5a89554 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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) HasTag(CommandTag) bool {
	return false
}

func (c *commandFsPwd) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {

	if handleHelpRequest(c, args, writer) {
		return nil
	}

	fmt.Fprintf(writer, "%s\n", commandEnv.option.Directory)

	return nil
}