mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
bournish: Add 'reboot' command.
Suggested by Ricardo Wurmus. * guix/build/bournish.scm (reboot-command): New procedure. (%commands): Add it.
This commit is contained in:
parent
7c515a43b0
commit
813bcbc4ea
1 changed files with 13 additions and 1 deletions
|
@ -162,6 +162,17 @@ (define (wc-command . args)
|
|||
(else
|
||||
`((@@ (guix build bournish) wc-command-implementation) ,@args))))
|
||||
|
||||
(define (reboot-command . args)
|
||||
"Emit code for 'reboot'."
|
||||
;; Normally Bournish is used in the initrd, where 'reboot' is provided
|
||||
;; directly by (guile-user). In other cases, just bail out.
|
||||
`(if (defined? 'reboot)
|
||||
(reboot)
|
||||
(begin
|
||||
(format (current-error-port)
|
||||
"I don't know how to reboot, sorry about that!~%")
|
||||
#f)))
|
||||
|
||||
(define (help-command . _)
|
||||
(display "\
|
||||
Hello, this is Bournish, a minimal Bourne-like shell in Guile!
|
||||
|
@ -189,7 +200,8 @@ (define %commands
|
|||
("ls" ,ls-command)
|
||||
("which" ,which-command)
|
||||
("cat" ,cat-command)
|
||||
("wc" ,wc-command)))
|
||||
("wc" ,wc-command)
|
||||
("reboot" ,reboot-command)))
|
||||
|
||||
(define (read-bournish port env)
|
||||
"Read a Bournish expression from PORT, and return the corresponding Scheme
|
||||
|
|
Loading…
Reference in a new issue