9 static struct fmt_ops
*get_ops(char *name
)
11 if (!strcmp(name
, "troff"))
13 if (!strcmp(name
, "latex"))
15 if (!strcmp(name
, "html"))
20 static char *version
=
22 "Copyright (C) 2009 Ali Gholami Rudi\n"
23 "You can redistribute and/or modify ctxt under the terms\n"
24 "of GNU General Public License. For more information, see\n"
28 "usage: ctxt [-m mode] <plaintext >formatted\n\n"
29 " -m\t\toutput format: latex or html (default: latex)\n"
30 " -h\t\tshow this screen\n"
31 " -v\t\tshow version\n";
33 int main(int argc
, char **argv
)
40 while ((c
= getopt(argc
, argv
, "hvm:")) != -1) {
54 die("bad command line option\n");
57 if (!(ops
= get_ops(mode
)))
58 die("unknown output format\n");
59 txt
= txt_alloc(STDIN_FILENO
);
60 doc
= doc_alloc(STDOUT_FILENO
);
61 format(doc
, txt
, ops
);