From 2e00a24994e094efc47fce4501b134caa801ea2c Mon Sep 17 00:00:00 2001 From: gramanas Date: Thu, 11 Nov 2021 20:31:07 +0200 Subject: Add readme & help --- README.org | 39 ++++++++++++++++++++++++++++++++++++++- main.c | 13 +++++++++---- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index 9504c5b..909ef3e 100644 --- a/README.org +++ b/README.org @@ -1,9 +1,13 @@ +#+STARTUP: hidestars + +* example #+begin_src conf # title @ fried onion ## INGREDIENTS - # `!/path/to/rcp` to include it + # `!/path/to/rcp` to include it + # `2!/path/to/rcp` to include two of it # `a = b` set ingredient a to quantity b onion = 2 salt = 1tsp @@ -43,3 +47,36 @@ + list recipies with path + or with title + or both + +* parse +** Input + Recipe file [[example]] +** Output + Struct with raw steps and subrecipes + +* eval + +** Input + parser output +** Output + Struct with + - finalised ingredients + - resolved steps + - subrecipes still remain + +** EvalSteps + + Step also has: + - duration :: string or null + - result? :: string or null + - variables? :: list of strings or null + + #+begin_src C + struct resolved_step { + char * text; + char * duration; + char * result; + char ** ingredients; + } + #+end_src + diff --git a/main.c b/main.c index 5012bb2..68de644 100644 --- a/main.c +++ b/main.c @@ -20,9 +20,14 @@ static struct opts { }; void -print_help() { - printf("Help!\n"); - +print_help(char * argv0) { + printf("%s [OPTION] FILE ...\n", argv0); + printf("OPTIONS:\n"); + printf("--format json,html,rcp\n"); + printf("--to-{json,html,rcp}\n"); + printf("-j json\n"); + printf("-w html\n"); + printf("-r rcp\n"); } int @@ -95,7 +100,7 @@ main(int argc, char * argv[]) } if (opt.help) { - print_help(); + print_help(argv[0]); return 0; } -- cgit v1.2.3