scq/smu.c

30 lines
747 B
C
Raw Normal View History

/* libsmu - simple markup library
* Copyright (C) <2007, 2008> Enno Boland <g s01 de>
*
* See LICENSE for further informations
*/
2007-12-10 02:35:44 +01:00
#include <stdlib.h>
#include <string.h>
#include "smu.h"
2007-12-10 02:35:44 +01:00
int
main(int argc, char *argv[]) {
int no = 0;
FILE *in = stdin;
2007-12-10 02:35:44 +01:00
if(argc > 1 && strcmp("-v", argv[1]) == 0)
2008-03-16 13:48:41 +01:00
eprint("simple markup %s (C) Enno Boland\n",VERSION);
2007-12-10 02:35:44 +01:00
else if(argc > 1 && strcmp("-h", argv[1]) == 0)
2007-12-10 11:33:18 +01:00
eprint("Usage %s [-n] [file]\n -n escape html strictly\n",argv[0]);
if(argc > 1 && strcmp("-n", argv[1]) == 0)
no = 1;
if(argc > 1 + no
&& strcmp("-", argv[1 + no]) != 0
&& !(in = fopen(argv[1 + no],"r")))
eprint("Cannot open file `%s`\n",argv[1 + no]);
smu_convert(stdout, in, no);
fclose(in);
2007-12-14 20:13:58 +01:00
return EXIT_SUCCESS;
2007-12-10 02:35:44 +01:00
}