Allow user to select stylesheet from command line

This commit is contained in:
David Baer
2015-08-14 22:43:41 -04:00
parent 10927bee25
commit 83fad2f6c4
3 changed files with 13 additions and 6 deletions

View File

@@ -14,8 +14,9 @@ int main(int argc, char* argv[]) {
Sermon sermon;
xmlDocPtr document, transformed;
int i = 0, block = 0, normal = 0;
InitOptions(argc, argv);
InitOptions(argc, (const char**)argv);
InitSermon(&sermon);
if (strcmp(options.inputFileName, "-") == 0) {
yyin = stdin;
} else {
@@ -24,12 +25,12 @@ int main(int argc, char* argv[]) {
yyparse(&sermon);
document = sermonToXmlDoc(&sermon);
transformed = applyStyleSheet(document, "html5");
transformed = applyStyleSheet(document, options.styleSheetName);
printXML(transformed);
xmlFreeDoc(document);
xmlFreeDoc(transformed);
/* clean up, clean up, everybody, everywhere! */
xmlFreeDoc(document);
xmlFreeDoc(transformed);
FreeSermon(&sermon);
if (strcmp(options.inputFileName, "-") != 0) {
fclose(yyin);