diff options
Diffstat (limited to 'src/food.c')
-rw-r--r-- | src/food.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -13,6 +13,8 @@ static struct opts { int html; int rcp; char query[2048]; + char includes[100][2048]; + int includes_n; int title; int eval; int list; @@ -25,6 +27,8 @@ static struct opts { .html = 0, .rcp = 0, .query = "", + .includes = {""}, + .includes_n = 0, .eval = 1, .title = 0, .list = 0, @@ -68,6 +72,7 @@ main(int argc, char * argv[]) {"to-html", no_argument, 0, 'w'}, {"to-rcp", no_argument, 0, 'r'}, {"format", required_argument, 0, 'f'}, + {"include", required_argument, 0, 'I'}, {"search", required_argument, 0, 's'}, {"title", required_argument, 0, 't'}, {"strict", required_argument, 0, 'S'}, @@ -79,7 +84,7 @@ main(int argc, char * argv[]) int option_index = 0; - c = getopt_long (argc, argv, "jnlhrwf:s:S:t:H:", + c = getopt_long (argc, argv, "jnlhrwf:s:S:t:H:I:", long_options, &option_index); if (c == -1) @@ -104,6 +109,9 @@ main(int argc, char * argv[]) else fprintf(stderr, "invalid format: %s\n", optarg); break; + case 'I': + strcpy(opt.includes[opt.includes_n++], optarg); + break; case 't': opt.title = 1; strcpy(opt.query, optarg); @@ -153,7 +161,9 @@ main(int argc, char * argv[]) } char ** lib = NULL; - int n = collect_library(&lib, argv, argc, optind); + int n = collect_library(&lib, + argv, argc, optind, + opt.includes, opt.includes_n); for (int i = 0; i < n; i++) { recipe * r = parse(lib[i], NULL); |