You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
522 B

  1. package shell
  2. import (
  3. "fmt"
  4. "io"
  5. )
  6. func init() {
  7. commands = append(commands, &commandFsPwd{})
  8. }
  9. type commandFsPwd struct {
  10. }
  11. func (c *commandFsPwd) Name() string {
  12. return "fs.pwd"
  13. }
  14. func (c *commandFsPwd) Help() string {
  15. return `print out current directory`
  16. }
  17. func (c *commandFsPwd) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
  18. fmt.Fprintf(writer, "http://%s:%d%s\n",
  19. commandEnv.option.FilerHost,
  20. commandEnv.option.FilerPort,
  21. commandEnv.option.Directory,
  22. )
  23. return nil
  24. }