From 21f4fbdd8453e489fb89825c4226a0a0bda2bc17 Mon Sep 17 00:00:00 2001 From: zimoun Date: Wed, 15 Jan 2020 18:00:03 +0100 Subject: refresh: Add '--load-path' option. * guix/scripts/refresh.scm (%option): Add '--load-path' option. * doc/guix.texi: Document it. --- guix/scripts/refresh.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'guix/scripts/refresh.scm') diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index daf6fcf947..bc8e906054 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2020 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,6 +28,7 @@ (define-module (guix scripts refresh) #:use-module (guix ui) #:use-module (gcrypt hash) #:use-module (guix scripts) + #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix store) #:use-module (guix utils) #:use-module (guix packages) @@ -116,6 +118,19 @@ (define %options (leave (G_ "unsupported policy: ~a~%") arg))))) + ;; The short option -L is already used by --list-updaters, therefore + ;; it needs to be removed from %standard-build-options. + (let ((%load-path-option (find (lambda (option) + (member "load-path" + (option-names option))) + %standard-build-options))) + (option + (filter (lambda (name) (not (equal? #\L name))) + (option-names %load-path-option)) + (option-required-arg? %load-path-option) + (option-optional-arg? %load-path-option) + (option-processor %load-path-option))) + (option '(#\h "help") #f #f (lambda args (show-help) @@ -165,6 +180,9 @@ (define (show-help) 'always', 'never', and 'interactive', which is also used when 'key-download' is not specified")) (newline) + (display (G_ " + --load-path=DIR prepend DIR to the package module search path")) + (newline) (display (G_ " -h, --help display this help and exit")) (display (G_ " -- cgit v1.2.3