Allow setting the status with a Boolean.
* gash/environment.scm (set-status!): Allow numerical or boolean input.
This commit is contained in:
parent
18aefdda18
commit
1cd6f963ea
|
@ -1,5 +1,6 @@
|
||||||
;;; Gash -- Guile As SHell
|
;;; Gash -- Guile As SHell
|
||||||
;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
|
;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
|
||||||
|
;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of Gash.
|
;;; This file is part of Gash.
|
||||||
;;;
|
;;;
|
||||||
|
@ -71,7 +72,12 @@
|
||||||
|
|
||||||
(define (set-status! n)
|
(define (set-status! n)
|
||||||
"Set the current status."
|
"Set the current status."
|
||||||
(set! *status* n))
|
(match n
|
||||||
|
((? number?)
|
||||||
|
(set! *status* n))
|
||||||
|
(#t (set-status! 0))
|
||||||
|
(#f (set-status! 1))
|
||||||
|
(_ (throw 'invalid-status n))))
|
||||||
|
|
||||||
(define *root-pid* (getpid))
|
(define *root-pid* (getpid))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue