aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man/blogc.1.ronn5
-rw-r--r--src/blogc/main.c9
2 files changed, 4 insertions, 10 deletions
diff --git a/man/blogc.1.ronn b/man/blogc.1.ronn
index 8bcd12d..8b5b52f 100644
--- a/man/blogc.1.ronn
+++ b/man/blogc.1.ronn
@@ -72,11 +72,6 @@ designed to be used with make(1).
is useful to get parameters for your `Makefile`, like the last page when
implementing pagination, see blogc-pagination(7) for details. This option can
also dump variables defined in a source file, if called without `-l`.
- Please note that variables generated by blogc during rendering process, like
- `BLOGC_RUSAGE_MEMORY` are not available, because blogc will exit without
- rendering any content when called with this option, and will not even require
- a template. However, variables generated during parsing process, like
- `CONTENT` are available.
* `-t` <TEMPLATE>:
Template file. It is a required option, if `blogc` needs to render something.
diff --git a/src/blogc/main.c b/src/blogc/main.c
index 5a4df99..2f93d18 100644
--- a/src/blogc/main.c
+++ b/src/blogc/main.c
@@ -315,13 +315,11 @@ main(int argc, char **argv)
}
if (print != NULL) {
- const char *val = NULL;
+ bc_trie_t *local = NULL;
if (!listing && s != NULL) {
- val = bc_trie_lookup(s->data, print);
- }
- if (val == NULL) {
- val = bc_trie_lookup(config, print);
+ local = s->data;
}
+ char *val = blogc_format_variable(print, config, local, NULL);
if (val == NULL) {
fprintf(stderr, "blogc: error: variable not found: %s\n",
print);
@@ -330,6 +328,7 @@ main(int argc, char **argv)
else {
printf("%s\n", val);
}
+ free(val);
goto cleanup2;
}