From 5b236ceef30a0105adfb2b04931b621fe36d9ce9 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Thu, 16 May 2019 20:30:54 -0400 Subject: [PATCH] Structure 'echo' like all the other built-ins. * gash/built-ins/echo.scm (echo): Rename this... (main): ...to this, and do not export it. * gash/built-ins.scm: Reference the 'main' function of the 'echo' module using '@@'. --- gash/built-ins.scm | 3 +-- gash/built-ins/echo.scm | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gash/built-ins.scm b/gash/built-ins.scm index 001b4c0..ab37cd5 100644 --- a/gash/built-ins.scm +++ b/gash/built-ins.scm @@ -17,7 +17,6 @@ ;;; along with Gash. If not, see . (define-module (gash built-ins) - #:use-module (gash built-ins echo) #:export (search-built-ins search-special-built-ins)) @@ -72,7 +71,7 @@ ("unalias" . ,undefined) ("wait" . ,undefined) ;; Other built-ins. - ("echo" . ,echo))) + ("echo" . ,(@@ (gash built-ins echo) main)))) (define (search-special-built-ins name) (assoc-ref *special-built-ins* name)) diff --git a/gash/built-ins/echo.scm b/gash/built-ins/echo.scm index 2a5d6da..de94fde 100644 --- a/gash/built-ins/echo.scm +++ b/gash/built-ins/echo.scm @@ -20,8 +20,7 @@ (define-module (gash built-ins echo) #:use-module (ice-9 match) #:use-module (srfi srfi-1) - #:use-module (srfi srfi-26) - #:export (echo)) + #:use-module (srfi srfi-26)) ;;; Commentary: ;;; @@ -57,7 +56,7 @@ (char=? (string-ref str 0) #\-) (string-every (cut member <> '(#\E #\e #\n)) (substring str 1)))) -(define (echo . args) +(define (main . args) (let* ((options (append-map (compose cdr string->list) (take-while option? args))) (args (drop-while option? args))