aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-make/rules.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2018-07-26 22:23:30 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2018-07-26 22:23:30 +0200
commitdefb396ee51c80d2df1c7bbc58dbefd0c6a0b165 (patch)
tree4af8d88b10a57cc5c8e18147c6fe0696c2f33867 /src/blogc-make/rules.c
parent69caadbe08b27188ac0ab3bd0e49bf3ee4f8244c (diff)
downloadblogc-defb396ee51c80d2df1c7bbc58dbefd0c6a0b165.tar.gz
blogc-defb396ee51c80d2df1c7bbc58dbefd0c6a0b165.tar.bz2
blogc-defb396ee51c80d2df1c7bbc58dbefd0c6a0b165.zip
make: added atom_dump helper rule
Diffstat (limited to 'src/blogc-make/rules.c')
-rw-r--r--src/blogc-make/rules.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/blogc-make/rules.c b/src/blogc-make/rules.c
index 9d599cc..d95edd8 100644
--- a/src/blogc-make/rules.c
+++ b/src/blogc-make/rules.c
@@ -13,6 +13,7 @@
#include <time.h>
#include <math.h>
#include "../common/utils.h"
+#include "atom.h"
#include "ctx.h"
#include "exec.h"
#include "exec-native.h"
@@ -626,6 +627,20 @@ watch_exec(bm_ctx_t *ctx, bc_slist_t *outputs, bc_trie_t *args)
}
+// ATOM DUMP RULE
+
+static int
+atom_dump_exec(bm_ctx_t *ctx, bc_slist_t *outputs, bc_trie_t *args)
+{
+ char *content = bm_atom_generate(ctx->settings);
+ if (content == NULL)
+ return 3;
+ printf("%s", content);
+ free(content);
+ return 0;
+}
+
+
const bm_rule_t rules[] = {
{
.name = "all",
@@ -713,6 +728,13 @@ const bm_rule_t rules[] = {
.exec_func = watch_exec,
.generate_files = false,
},
+ {
+ .name = "atom_dump",
+ .help = "dump default Atom feed template based on current settings",
+ .outputlist_func = NULL,
+ .exec_func = atom_dump_exec,
+ .generate_files = false,
+ },
{NULL, NULL, NULL, NULL, false},
};