builtins: cd: Support `cd -'.
* gash/builtins.scm (cd-command): Support `cd -'.
This commit is contained in:
parent
56a36baee5
commit
97a95ee002
|
@ -48,9 +48,11 @@
|
|||
|
||||
(define (cd-command . args)
|
||||
(match args
|
||||
(() (chdir (getenv "HOME")))
|
||||
(() (cd-command (getenv "HOME")))
|
||||
((dir)
|
||||
(chdir dir))
|
||||
(assignment "OLDPWD" (getcwd))
|
||||
(if (string=? dir "-") (chdir (variable "OLDPWD"))
|
||||
(chdir dir)))
|
||||
((args ...)
|
||||
(format (current-error-port) "cd: too many arguments: ~a\n" (string-join args)))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue