diff options
-rw-r--r-- | cook/cli.scm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cook/cli.scm b/cook/cli.scm new file mode 100644 index 0000000..1b5db87 --- /dev/null +++ b/cook/cli.scm @@ -0,0 +1,27 @@ +(import (cook parse-internals) + (cook debug) + (chibi) + (chibi app) + (chibi config) + (chibi io) + (chibi test)) + +(define (cook cfg spec . args) + (display "called cook with: ") + (display args) + (newline)) + +(define (read-cook cfg spec recipe-file) + (let ((recipe (parse-cook (file->string recipe-file)))) + (display (cook->list recipe)))) + +(run-application + `(cook + "Cooklang recipe tool" + (@ + (help boolean (#\h ) "show this help")) + (or + (help "Show this help" () (,app-help-command)) + (read "Read recipe in the terminal" () (,read-cook recipe))) + (,cook files ...)) + (command-line)) |