command_fs_pwd.go 509 B

1234567891011121314151617181920212223242526272829303132
  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) HasTag(CommandTag) bool {
  18. return false
  19. }
  20. func (c *commandFsPwd) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {
  21. fmt.Fprintf(writer, "%s\n", commandEnv.option.Directory)
  22. return nil
  23. }