aboutsummaryrefslogtreecommitdiff
path: root/guix-package.in
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-11-03 21:19:43 +0100
committerLudovic Courtès <ludo@gnu.org>2012-11-03 21:19:43 +0100
commitcdd5d6f95f416078509bce509b25c7c854da34a2 (patch)
tree41801084dc6c6b461d4b87192f1c581b08dbc60e /guix-package.in
parent00e219d1c98e55dd1b6c6af00ae73c23ed52583e (diff)
downloadpatches-cdd5d6f95f416078509bce509b25c7c854da34a2.tar
patches-cdd5d6f95f416078509bce509b25c7c854da34a2.tar.gz
ui: Factorize `--version'.
* guix/ui.scm (show-version-and-exit): New procedure. * guix-build.in (show-version): Remove. (%options)["version"]: Use `show-version-and-exit'. * guix-download.in: Likewise. * guix-package.in: Likewise.
Diffstat (limited to 'guix-package.in')
-rw-r--r--guix-package.in7
1 files changed, 2 insertions, 5 deletions
diff --git a/guix-package.in b/guix-package.in
index 5b10149d9f..3a226bdca8 100644
--- a/guix-package.in
+++ b/guix-package.in
@@ -30,6 +30,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0" \
;;; along with Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (guix-package)
+ #:use-module (guix ui)
#:use-module (guix store)
#:use-module (guix derivations)
#:use-module (guix packages)
@@ -192,9 +193,6 @@ all of PACKAGES, a list of name/version/output/path tuples."
(format (current-error-port) fmt args ...)
(exit 1)))
-(define (show-version)
- (display "guix-package (@PACKAGE_NAME@) @PACKAGE_VERSION@\n"))
-
(define (show-help)
(display (_ "Usage: guix-package [OPTION]... PACKAGES...
Install, remove, or upgrade PACKAGES in a single transaction.\n"))
@@ -228,8 +226,7 @@ Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(exit 0)))
(option '(#\V "version") #f #f
(lambda args
- (show-version)
- (exit 0)))
+ (show-version-and-exit "guix-package")))
(option '(#\i "install") #t #f
(lambda (opt name arg result)