]> git.jsancho.org Git - guile-click.git/blobdiff - click/util.scm
Move value functions to a separated file
[guile-click.git] / click / util.scm
index e83e15319a915d16cb43e2ab4cfc14efe207126b..8a4f771676e14e985772e1d08c8af37cc3c95e62 100644 (file)
@@ -22,9 +22,6 @@
   #:use-module (ice-9 readline)
   #:use-module (click constant)
   #:export (getopt-long-option-spec
-            get-option-default-value
-            get-values
-            option-default-value
             option-property
             program-name
             %program-name))
     (if property
         (cadr property)
         default)))
-
-(define (get-values option-spec values)
-  "Return an associated list with values for all the options in option-spec"
-  (cond ((null? option-spec)
-         '())
-        (else
-         (let* ((option (car option-spec))
-                (option-name (car option))
-                (value (or (option-ref values option-name #f)
-                           (get-option-default-value option))))
-           (cons (cons option-name value)
-                 (get-values (cdr option-spec) values))))))
-
-
-(define* (get-option-default-value option #:optional (no-prompt #f))
-  "Get value for option, asking user if prompt property is set"
-  (let ((default (option-property option 'default)))
-    (if (not default)
-        (let ((prompt (option-property option 'prompt)))
-          (if prompt
-              (readline (format #f "~a: " prompt))
-              default))
-        default)))