guile: update scripts

Some minor improvements to the existing scripts
This commit is contained in:
Dirk-Jan C. Binnema
2022-11-16 22:14:02 +02:00
parent e02df6c786
commit 46c741ec9a
5 changed files with 44 additions and 38 deletions

View File

@ -38,16 +38,17 @@ arguments). Possible arguments are:
searchexpr (a search query)
then call FUNC with args SEARCHEXPR and OUTPUT."
(setlocale LC_ALL "")
(let* ((optionspec '((muhome (value #t))
(query (value #t))
(output (value #f))
(help (single-char #\h) (value #f))))
(options (getopt-long args optionspec))
(query (option-ref options 'query #f))
(help (option-ref options 'help #f))
(output (option-ref options 'output #f))
(muhome (option-ref options 'muhome #f))
(restargs (option-ref options '() #f)))
(let* ((optionspec '((muhome (value #t))
(query (value #t))
(output (value #f))
(time-unit (value #t)) ;; Ignore.
(help (single-char #\h) (value #f))))
(options (getopt-long args optionspec))
(query (option-ref options 'query #f))
(help (option-ref options 'help #f))
(output (option-ref options 'output #f))
(muhome (option-ref options 'muhome #f))
(restargs (option-ref options '() #f)))
(if help (help-and-exit))
(mu:initialize muhome)
(func (or query "") output)))