Add the set built-in
* geesh/environment.scm: Export set-environment-arguments!. * geesh/built-ins/set.scm: New file. * Makefile.am: Add them. * geesh/built-ins.scm: Add set.
This commit is contained in:
parent
a5a1f85aa7
commit
0d41cec2d6
|
@ -48,6 +48,7 @@ MODULES = \
|
|||
geesh/built-ins/false.scm \
|
||||
geesh/built-ins/read.scm \
|
||||
geesh/built-ins/readonly.scm \
|
||||
geesh/built-ins/set.scm \
|
||||
geesh/built-ins/true.scm \
|
||||
geesh/built-ins/unset.scm \
|
||||
geesh/built-ins/utils.scm \
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
("export" . ,(@@ (geesh built-ins export) main))
|
||||
("readonly" . ,(@@ (geesh built-ins readonly) main))
|
||||
("return" . ,undefined)
|
||||
("set" . ,undefined)
|
||||
("set" . ,(@@ (geesh built-ins set) main))
|
||||
("shift" . ,undefined)
|
||||
("times" . ,undefined)
|
||||
("trap" . ,undefined)
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
;;; The Geesh Shell Interpreter
|
||||
;;; Copyright 2018 Timothy Sample <samplet@ngyro.com>
|
||||
;;;
|
||||
;;; This file is part of Geesh.
|
||||
;;;
|
||||
;;; Geesh is free software: you can redistribute it and/or modify
|
||||
;;; it under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation, either version 3 of the License, or
|
||||
;;; (at your option) any later version.
|
||||
;;;
|
||||
;;; Geesh is distributed in the hope that it will be useful,
|
||||
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with Geesh. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(define-module (geesh built-ins set)
|
||||
#:use-module (geesh environment)
|
||||
#:use-module (ice-9 match))
|
||||
|
||||
;;; Commentary:
|
||||
;;;
|
||||
;;; The 'set' utility.
|
||||
;;;
|
||||
;;; Code:
|
||||
|
||||
|
||||
(define (main env . args)
|
||||
(match args
|
||||
(("--" . args) (set-environment-arguments! env args))
|
||||
(_ (throw 'not-implemented (string-join (cons "set" args))))))
|
|
@ -38,6 +38,7 @@
|
|||
define-environment-function!
|
||||
delete-environment-functions!
|
||||
environment-arguments
|
||||
set-environment-arguments!
|
||||
with-environment-arguments
|
||||
environment-break-prompt
|
||||
environment-continue-prompt))
|
||||
|
|
Loading…
Reference in New Issue