aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-make/rules.c
diff options
context:
space:
mode:
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},
};