aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2016-07-01 14:39:21 +0200
committerMathieu Lirzin <mthl@gnu.org>2016-07-01 16:00:14 +0200
commita62624301bc7ffef4996364a208b17cd7f3584bc (patch)
treea32cf1394c86cf7f21517a86aa789bbd7f5a9260 /bin
parent0f04df269157ee005d7030196780c738c67c5a0a (diff)
downloadcuirass-a62624301bc7ffef4996364a208b17cd7f3584bc.tar
cuirass-a62624301bc7ffef4996364a208b17cd7f3584bc.tar.gz
base: Add %program-name parameter object.
Diffstat (limited to 'bin')
-rw-r--r--bin/cuirass.in31
1 files changed, 16 insertions, 15 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in
index edcf940..cd01c94 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -28,8 +28,8 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@"
(cuirass ui)
(ice-9 getopt-long))
-(define* (show-help prog)
- (simple-format #t "Usage: ~a [OPTIONS] [CACHEDIR]" prog)
+(define* (show-help)
+ (simple-format #t "Usage: ~a [OPTIONS] [CACHEDIR]" (%program-name))
(display "
Run Guix job from a git repository cloned in CACHEDIR.
@@ -113,19 +113,20 @@ DIR if required."
;;;
(define* (main #:optional (args (command-line)))
- (let ((opts (getopt-long args %options))
- (progname "cuirass"))
- (cond
- ((option-ref opts 'help #f)
- (show-help progname)
- (exit 0))
- ((option-ref opts 'version #f)
- (show-version progname)
- (exit 0))
- (else
- (parameterize ((%package-database
- (option-ref opts 'database (%package-database))))
+ (let ((opts (getopt-long args %options)))
+ (parameterize
+ ((%program-name (car args))
+ (%package-database (option-ref opts 'database (%package-database))))
+ (cond
+ ((option-ref opts 'help #f)
+ (show-help)
+ (exit 0))
+ ((option-ref opts 'version #f)
+ (show-version)
+ (exit 0))
+ (else
(let* ((specfile (option-ref opts 'file "tests/hello-subset.scm"))
+ (interval (option-ref opts 'interval "60"))
(specs (primitive-load specfile))
(args (option-ref opts '() #f))
(cachedir (if (null? args)
@@ -148,4 +149,4 @@ DIR if required."
(lambda ()
((guix-variable 'store 'close-connection) store)))))
specs)
- (sleep (string->number (option-ref opts 'interval "60")))))))))))
+ (sleep (string->number interval))))))))))