From 0d2794005caa627965fd6256f28f94e36cd4b5a0 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 9 Aug 2015 11:35:51 -0400 Subject: 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. --- guix/scripts/package.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'guix/scripts/package.scm') 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 @@ (define (show-help) -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 @@ (define %options (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)) -- cgit v1.2.3