From 29479de5659ba912b486c74078403bbb9a4df104 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 13 Sep 2013 23:42:36 +0200 Subject: substitute-binary: Add '--help'. Reported by Nikita Karetnikov . * guix/scripts/substitute-binary.scm (show-help): New procedure. (guix-substitute-binary): Add '--help'. --- guix/scripts/substitute-binary.scm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'guix/scripts') diff --git a/guix/scripts/substitute-binary.scm b/guix/scripts/substitute-binary.scm index 63f0c4f8d2..1afc93bbc9 100755 --- a/guix/scripts/substitute-binary.scm +++ b/guix/scripts/substitute-binary.scm @@ -444,6 +444,30 @@ (define-syntax with-networking (leave (_ "host name lookup error: ~a~%") (gai-strerror error))))))) + +;;; +;;; Help. +;;; + +(define (show-help) + (display (_ "Usage: guix substitute-binary [OPTION]... +Internal tool to substitute a pre-built binary to a local build.\n")) + (display (_ " + --query report on the availability of substitutes for the + store file names passed on the standard input")) + (display (_ " + --substitute STORE-FILE DESTINATION + download STORE-FILE and store it as a Nar in file + DESTINATION")) + (newline) + (display (_ " + -h, --help display this help and exit")) + (display (_ " + -V, --version display version information and exit")) + (newline) + (show-bug-report-information)) + + ;;; ;;; Entry point. @@ -536,7 +560,11 @@ (define (guix-substitute-binary . args) (restore-file input destination) (every (compose zero? cdr waitpid) pids)))) (("--version") - (show-version-and-exit "guix substitute-binary"))))) + (show-version-and-exit "guix substitute-binary")) + (("--help") + (show-help)) + (opts + (leave (_ "~a: unrecognized options~%") opts))))) ;;; Local Variables: -- cgit v1.2.3