diff options
Diffstat (limited to 'commands/pwd.go')
-rw-r--r-- | commands/pwd.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/commands/pwd.go b/commands/pwd.go new file mode 100644 index 00000000..b4f3eb18 --- /dev/null +++ b/commands/pwd.go @@ -0,0 +1,25 @@ +package commands + +import ( + "errors" + "os" + "time" + + "git.sr.ht/~sircmpwn/aerc/widgets" +) + +func init() { + register("pwd", PrintWorkDirectory) +} + +func PrintWorkDirectory(aerc *widgets.Aerc, args []string) error { + if len(args) != 1 { + return errors.New("Usage: pwd") + } + pwd, err := os.Getwd() + if err != nil { + return err + } + aerc.PushStatus(pwd, 10*time.Second) + return nil +} |