43 lines
1,016 B
Scheme
43 lines
1,016 B
Scheme
|
#!/usr/bin/guile \
|
||
|
--no-auto-compile -e main -s
|
||
|
!#
|
||
|
|
||
|
(use-modules (config)
|
||
|
(config api)
|
||
|
(config parser sexp)
|
||
|
(ice-9 format)
|
||
|
(ice-9 match)
|
||
|
((ordo cli run) #:prefix run:)
|
||
|
(srfi srfi-1))
|
||
|
|
||
|
(define config
|
||
|
(configuration
|
||
|
(name 'ordo)
|
||
|
(synopsis "From chaos, comes order")
|
||
|
(description "Ordo configuration management.")
|
||
|
(keywords
|
||
|
(list
|
||
|
(setting
|
||
|
(name 'log-level)
|
||
|
(handler string->symbol)
|
||
|
(test symbol?)
|
||
|
(default 'NOTICE)
|
||
|
(example "DEBUG|INFO|NOTICE|WARN|ERROR")
|
||
|
(synopsis "Log level"))))
|
||
|
(parser sexp-parser)
|
||
|
(directory (in-cwd ".config/" #t))
|
||
|
(version "0.1.0")
|
||
|
(author "Ray Miller")
|
||
|
(license gpl3+)
|
||
|
(copyright (list 2025))
|
||
|
(subcommands
|
||
|
(list
|
||
|
run:config))))
|
||
|
|
||
|
(define (main cmd-line)
|
||
|
(let ((options (getopt-config-auto cmd-line config)))
|
||
|
(match (full-command options)
|
||
|
(("ordo" "run")
|
||
|
(run:handler options))
|
||
|
(_ (emit-help options)))))
|