summaryrefslogtreecommitdiff
path: root/cook
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2025-05-03 22:16:55 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2025-05-03 22:16:55 +0200
commit9eb062d7c2abf9a67000ea5dc63a28facd655365 (patch)
tree54d8c5a0a08414ff8f34195a3e0c4d14f8d1aeca /cook
parent1740e5fcf8a7f748b3ebdb4b0dd1002c035ddae5 (diff)
cli: add it
Diffstat (limited to 'cook')
-rw-r--r--cook/cli.scm27
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))