diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-01-20 22:58:16 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2024-01-20 22:58:16 +0200 |
| commit | 351829f43fef1ef758defdb22316b6a0d848e530 (patch) | |
| tree | a2d8ea7a6d1bfd61dca59f5b6ab57a8e0c868e29 /desmoctl.scm | |
| parent | 533b58c2dc692259a2dc5f47fc4b292e570bacb6 (diff) | |
Work on apply
Diffstat (limited to 'desmoctl.scm')
| -rw-r--r-- | desmoctl.scm | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/desmoctl.scm b/desmoctl.scm index 792ef69..5fc5bb3 100644 --- a/desmoctl.scm +++ b/desmoctl.scm @@ -2,24 +2,15 @@ (chicken base) (chicken process-context) (chicken format) + (chicken pretty-print) matchable test + utils desmo-apply desmo-status desmo-logs ) -(define should-run-inline-tests? - (let ((v (get-environment-variable "INLINE_TESTS"))) - (and (string? v) - (string=? v "1")))) - -(define-syntax inline-tests - (syntax-rules () - ((_ expr ...) - (if should-run-inline-tests? - (begin expr ...))))) - ; CLI arg parser (define usage-string @@ -113,15 +104,23 @@ ;; (print (format "debug: cli-subcommand: ~A" cli-subcommand)) ;; (print (format "debug: cli-opts: ~A" cli-opts)) +; read in config + +(define cfg-content + (read (open-input-file (cadr (assoc 'cfg-path cli-opts))))) + +(print "debug: cfg-content") +(pretty-print cfg-content) + ; evaluate parsed command -(define (eval-subcommand subcmd opts) +(define (eval-subcommand subcmd cfg) (match subcmd - ['cmd-apply (run-apply opts)] - ['cmd-status (run-status opts)] - ['cmd-logs (run-logs opts)] + ['cmd-apply (run-apply cfg)] + ['cmd-status (run-status cfg)] + ['cmd-logs (run-logs cfg)] ['cmd-help (print usage-string) 'done] [other (print `(eval-error ,(format "invalid subcommand: ~A" other)))])) -(eval-subcommand cli-subcommand cli-opts) +(eval-subcommand cli-subcommand cfg-content) |
