2008-06-18 08:00:18 +02:00
|
|
|
/* libsmu - simple markup library
|
|
|
|
* Copyright (C) <2007, 2008> Enno Boland <g s01 de>
|
2007-12-10 04:08:02 +01:00
|
|
|
*
|
2007-12-10 12:43:27 +01:00
|
|
|
* See LICENSE for further informations
|
2007-12-10 04:08:02 +01:00
|
|
|
*/
|
2007-12-10 02:35:44 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2008-06-18 08:00:18 +02:00
|
|
|
#include "smu.h"
|
2007-12-10 02:35:44 +01:00
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[]) {
|
2008-06-18 08:00:18 +02:00
|
|
|
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)
|
2008-06-18 08:00:18 +02:00
|
|
|
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
|
|
|
}
|