Skeleton CLI using guile-config
This commit is contained in:
commit
8426126b30
5 changed files with 262 additions and 0 deletions
42
ordo.scm
Executable file
42
ordo.scm
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/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)))))
|
Loading…
Add table
Add a link
Reference in a new issue