From 3afa72febc3d6ed7003d10f3a5c4211bf761d746 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Wed, 3 Apr 2019 00:39:56 +0200 Subject: make: added support for `blogc -e` must still add tests --- src/blogc-make/exec.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/blogc-make/exec.c') diff --git a/src/blogc-make/exec.c b/src/blogc-make/exec.c index cd71810..a78d506 100644 --- a/src/blogc-make/exec.c +++ b/src/blogc-make/exec.c @@ -219,7 +219,8 @@ list_variables(const char *key, const char *value, bc_string_t *str) char* bm_exec_build_blogc_cmd(const char *blogc_bin, bm_settings_t *settings, bc_trie_t *global_variables, bc_trie_t *local_variables, bool listing, - const char *template, const char *output, bool dev, bool sources_stdin) + const char *listing_entry, const char *template, const char *output, + bool dev, bool sources_stdin) { bc_string_t *rv = bc_string_new(); @@ -255,6 +256,11 @@ bm_exec_build_blogc_cmd(const char *blogc_bin, bm_settings_t *settings, if (listing) { bc_string_append(rv, " -l"); + if (listing_entry != NULL) { + char *tmp = bc_shell_quote(listing_entry); + bc_string_append_printf(rv, " -e %s", tmp); + free(tmp); + } } if (template != NULL) { @@ -279,8 +285,8 @@ bm_exec_build_blogc_cmd(const char *blogc_bin, bm_settings_t *settings, int bm_exec_blogc(bm_ctx_t *ctx, bc_trie_t *global_variables, bc_trie_t *local_variables, - bool listing, bm_filectx_t *template, bm_filectx_t *output, bc_slist_t *sources, - bool only_first_source) + bool listing, bm_filectx_t *listing_entry, bm_filectx_t *template, + bm_filectx_t *output, bc_slist_t *sources, bool only_first_source) { if (ctx == NULL) return 1; @@ -293,8 +299,8 @@ bm_exec_blogc(bm_ctx_t *ctx, bc_trie_t *global_variables, bc_trie_t *local_varia } char *cmd = bm_exec_build_blogc_cmd(ctx->blogc, ctx->settings, global_variables, - local_variables, listing, template->path, output->path, ctx->dev, - input->len > 0); + local_variables, listing, listing_entry == NULL ? NULL : listing_entry->path, + template->path, output->path, ctx->dev, input->len > 0); if (ctx->verbose) printf("%s\n", cmd); -- cgit v1.2.3-18-g5258