diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-04-11 22:30:06 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-04-11 22:30:06 +0200 |
commit | a2011be5dfaf2b94a1d0e3dfbcf4b512389b4711 (patch) | |
tree | 5e1745f40400c87bd23d641ef31dc460ca3693c2 /guix/scripts/gc.scm | |
parent | 53c63ee93790e4e4054bf6547199d3490b78bf47 (diff) | |
download | gnu-guix-a2011be5dfaf2b94a1d0e3dfbcf4b512389b4711.tar gnu-guix-a2011be5dfaf2b94a1d0e3dfbcf4b512389b4711.tar.gz |
ui: Add a `warning' macro.
* guix/ui.scm (program-name, guix-warning-port): New variables.
(warning): New macro.
(guix-main): Parametrize PROGRAM-NAME.
* guix/scripts/build.scm, guix/scripts/download.scm,
guix/scripts/gc.scm, guix/scripts/package.scm: Adjust to use `leave'
and `warning' consistently.
Diffstat (limited to 'guix/scripts/gc.scm')
-rw-r--r-- | guix/scripts/gc.scm | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index 12d80fd171..3d918923f8 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm @@ -87,13 +87,9 @@ interpreted." ("TB" (expt 10 12)) ("" 1) (_ - (format (current-error-port) (_ "error: unknown unit: ~a~%") - unit) + (leave (_ "error: unknown unit: ~a~%") unit) (exit 1)))) - (begin - (format (current-error-port) - (_ "error: invalid number: ~a") numstr) - (exit 1))))) + (leave (_ "error: invalid number: ~a") numstr)))) (define %options ;; Specification of the command-line options. @@ -114,11 +110,8 @@ interpreted." (let ((amount (size->number arg))) (if arg (alist-cons 'min-freed amount result) - (begin - (format (current-error-port) - (_ "error: invalid amount of storage: ~a~%") - arg) - (exit 1))))) + (leave (_ "error: invalid amount of storage: ~a~%") + arg)))) (#f result))))) (option '(#\d "delete") #f #f (lambda (opt name arg result) |