ui: Factorize bug-report information in `--help'.

* guix/config.scm.in (%guix-home-page-url): New variable.
* guix/ui.scm (show-bug-report-information): New procedure.
* guix-build.in (show-help): Use it.
* guix-download.in (show-help): Likewise.
* guix-import.in (show-help): Likewise.
* guix-package.in (show-help): Likewise.
This commit is contained in:
Ludovic Courtès 2013-01-05 15:55:47 +01:00
parent 706d0641cf
commit 3441e16497
7 changed files with 25 additions and 14 deletions

View file

@ -12,7 +12,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0" \
-c "(apply $main (cdr (command-line)))" "$@"
!#
;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;
@ -104,8 +104,7 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
(display (_ "
-V, --version display version information and exit"))
(newline)
(format #t (_ "
Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(show-bug-report-information))
(define %options
;; Specifications of the command-line options.

View file

@ -12,7 +12,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0" \
-c "(apply $main (cdr (command-line)))" "$@"
!#
;;; Guix --- Nix package management from Guile.
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;
@ -90,8 +90,7 @@ and the hash of its contents.\n"))
(display (_ "
-V, --version display version information and exit"))
(newline)
(format #t (_ "
Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(show-bug-report-information))
(define %options
;; Specifications of the command-line options.

View file

@ -12,7 +12,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0" \
-c "(apply $main (cdr (command-line)))" "$@"
!#
;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;
@ -88,8 +88,7 @@ Import and convert the Nix expression ATTRIBUTE of NIXPKGS.\n"))
(display (_ "
-V, --version display version information and exit"))
(newline)
(format #t (_ "
Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(show-bug-report-information))
(define %options
;; Specification of the command-line options.

View file

@ -12,7 +12,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0" \
-c "(apply $main (cdr (command-line)))" "$@"
!#
;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;
@ -217,8 +217,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n"))
(display (_ "
-V, --version display version information and exit"))
(newline)
(format #t (_ "
Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(show-bug-report-information))
(define %options
;; Specification of the command-line options.

View file

@ -1,5 +1,5 @@
;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;
@ -20,6 +20,7 @@ (define-module (guix config)
#:export (%guix-package-name
%guix-version
%guix-bug-report-address
%guix-home-page-url
%store-directory
%state-directory
%system
@ -42,6 +43,9 @@ (define %guix-version
(define %guix-bug-report-address
"@PACKAGE_BUGREPORT@")
(define %guix-home-page-url
"@PACKAGE_URL@")
(define %store-directory
"@storedir@")

View file

@ -1,5 +1,5 @@
;;; Guix --- Nix package management from Guile. -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;
@ -28,6 +28,7 @@ (define-module (guix ui)
N_
leave
show-version-and-exit
show-bug-report-information
call-with-error-handling
with-error-handling
location->string))
@ -56,6 +57,15 @@ (define* (show-version-and-exit #:optional (command (car (command-line))))
command %guix-package-name %guix-version)
(exit 0))
(define (show-bug-report-information)
(format #t (_ "
Report bugs to: ~a.") %guix-bug-report-address)
(format #t (_ "
~a home page: <~a>") %guix-package-name %guix-home-page-url)
(display (_ "
General help using GNU software: <http://www.gnu.org/gethelp/>"))
(newline))
(define (call-with-error-handling thunk)
"Call THUNK within a user-friendly error handler."
(guard (c ((package-input-error? c)

View file

@ -7,3 +7,4 @@ distro/packages/recutils.scm
guix/ui.scm
guix-build.in
guix-download.in
guix-package.in