Add '-n' support to echo
* geesh/built-ins/echo.scm (echo): Omit trailing newline when '-n' is the first argument.
This commit is contained in:
parent
a6ceb8f3f2
commit
00d50fe7fd
|
@ -26,5 +26,8 @@
|
|||
;;; Code:
|
||||
|
||||
(define (echo env . args)
|
||||
(display (string-join args " "))
|
||||
(newline))
|
||||
(let* ((n? (and (pair? args) (string=? (car args) "-n")))
|
||||
(args (if n? (cdr args) args)))
|
||||
(display (string-join args " "))
|
||||
(unless n?
|
||||
(newline))))
|
||||
|
|
Loading…
Reference in New Issue