diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-05 20:56:19 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-05-05 20:56:19 +0200 |
commit | 2c77169856420c54e0873e1871d2e03c9ca2e7ea (patch) | |
tree | 83fd1803126c4b24da213ef50bf5ba233815bc44 /module | |
parent | Add link in root to /today. (diff) | |
download | calp-2c77169856420c54e0873e1871d2e03c9ca2e7ea.tar.gz calp-2c77169856420c54e0873e1871d2e03c9ca2e7ea.tar.xz |
Getopt-opt handles value being any symbol.
Diffstat (limited to '')
-rw-r--r-- | module/util/options.scm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/module/util/options.scm b/module/util/options.scm index 87390e27..89dde42d 100644 --- a/module/util/options.scm +++ b/module/util/options.scm @@ -8,9 +8,15 @@ (define-public (getopt-opt options) (map (lambda (optline) (cons (car optline) - (lset-intersection (lambda (a b) (eqv? b (car a))) - (cdr optline) - '(single-char required? value predicate)))) + (map (lambda (opt-field) + (cons (car opt-field) + (cond [(and (eq? 'value (car opt-field)) + (symbol? (cadr opt-field))) + '(optional)] + [else (cdr opt-field)]))) + (lset-intersection (lambda (a b) (eqv? b (car a))) + (cdr optline) + '(single-char required? value predicate))))) options)) |