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