aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts/package.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-08-09 11:35:51 -0400
committerDavid Thompson <dthompson2@worcester.edu>2015-08-19 22:23:59 -0400
commit0d2794005caa627965fd6256f28f94e36cd4b5a0 (patch)
tree065eb643a5a59653faa90206dc07d12996ebbb6d /guix/scripts/package.scm
parent83bde59fb3db5827002a0049a5571e4163af5ff1 (diff)
downloadgnu-guix-0d2794005caa627965fd6256f28f94e36cd4b5a0.tar
gnu-guix-0d2794005caa627965fd6256f28f94e36cd4b5a0.tar.gz
scripts: package: Add --install-from-file option.
* guix/scripts/package.scm (show-help): Add help text for --install-from-file option. (%options): Add --install-from-file option. * tests/guix-package.sh: Test it. * doc/guix.texi ("invoking guix package"): Document it. * doc/package-hello.scm: New file. * doc.am (EXTRA_DIST): Add it.
Diffstat (limited to 'guix/scripts/package.scm')
-rw-r--r--guix/scripts/package.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index b545ea2672..23f1597856 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -381,6 +381,10 @@ Install, remove, or upgrade packages in a single transaction.\n"))
-e, --install-from-expression=EXP
install the package EXP evaluates to"))
(display (_ "
+ -f, --install-from-file=FILE
+ install the package that the code within FILE
+ evaluates to"))
+ (display (_ "
-r, --remove PACKAGE ...
remove PACKAGEs"))
(display (_ "
@@ -454,6 +458,12 @@ Install, remove, or upgrade packages in a single transaction.\n"))
(values (alist-cons 'install (read/eval-package-expression arg)
result)
#f)))
+ (option '(#\f "install-from-file") #t #f
+ (lambda (opt name arg result arg-handler)
+ (values (alist-cons 'install
+ (load* arg (make-user-module '()))
+ result)
+ #f)))
(option '(#\r "remove") #f #t
(lambda (opt name arg result arg-handler)
(let arg-handler ((arg arg) (result result))