summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index be3d305..be1bfd9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -10,6 +10,7 @@
typedef enum {
FORMAT_NONE,
FORMAT_HTML,
+ FORMAT_XML,
FORMAT_MAN,
FORMAT_AST
} writer_format;
@@ -18,7 +19,7 @@ void print_usage()
{
printf("Usage: cmark [FILE*]\n");
printf("Options:\n");
- printf(" --to, -t FORMAT Specify output format (html, man, ast)\n");
+ printf(" --to, -t FORMAT Specify output format (html, xml, man, ast)\n");
printf(" --help, -h Print usage information\n");
printf(" --version Print version\n");
}
@@ -33,6 +34,9 @@ static void print_document(cmark_node *document, writer_format writer)
case FORMAT_HTML:
result = cmark_render_html(document);
break;
+ case FORMAT_XML:
+ result = cmark_render_xml(document);
+ break;
case FORMAT_MAN:
result = cmark_render_man(document);
break;
@@ -74,6 +78,8 @@ int main(int argc, char *argv[])
writer = FORMAT_MAN;
} else if (strcmp(argv[i], "html") == 0) {
writer = FORMAT_HTML;
+ } else if (strcmp(argv[i], "xml") == 0) {
+ writer = FORMAT_XML;
} else if (strcmp(argv[i], "ast") == 0) {
writer = FORMAT_AST;
} else {