From 9eb062d7c2abf9a67000ea5dc63a28facd655365 Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sat, 3 May 2025 22:16:55 +0200 Subject: cli: add it --- cook/cli.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 cook/cli.scm 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)) -- cgit v1.2.3