diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-11-19 23:02:59 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-11-19 23:04:38 +0100 |
commit | 64fc89b6ec0928f7bbd7011d6a8dc325d63f4fe5 (patch) | |
tree | 131fad75147e00ae73c7201f557df1fdd540011a /guix | |
parent | ba326ce41b5784f3acb99d4beae5ffc455d6a27e (diff) | |
download | gnu-guix-64fc89b6ec0928f7bbd7011d6a8dc325d63f4fe5.tar gnu-guix-64fc89b6ec0928f7bbd7011d6a8dc325d63f4fe5.tar.gz |
guix-package: Add `--list-available'.
* guix-package.in (show-help, %options): Add `--list-available'.
(guix-package)[process-query]: Add support for `--list-available'.
* doc/guix.texi (Invoking guix-package): Document it.
* tests/guix-package.sh: Add test.
* guix/ui.scm (location->string): New procedure.
* guix/utils.scm: Export <location>.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/ui.scm | 11 | ||||
-rw-r--r-- | guix/utils.scm | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/guix/ui.scm b/guix/ui.scm index 447c3a9a9f..4fc0dd089a 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -23,12 +23,14 @@ #:use-module (guix packages) #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) + #:use-module (ice-9 match) #:export (_ N_ leave show-version-and-exit call-with-error-handling - with-error-handling)) + with-error-handling + location->string)) ;;; Commentary: ;;; @@ -80,4 +82,11 @@ (lambda () body ...))))) +(define (location->string loc) + "Return a human-friendly, GNU-standard representation of LOC." + (match loc + (#f (_ "<unknown location>")) + (($ <location> file line column) + (format #f "~a:~a:~a" file line column)))) + ;;; ui.scm ends here diff --git a/guix/utils.scm b/guix/utils.scm index ff8730aa63..5ec8f3736d 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -47,6 +47,7 @@ default-keyword-arguments substitute-keyword-arguments + <location> location location? location-file |