Add a -E flag to theme to allow <?theme expansions

everywhere (except in html comments) instead of being
context-sensitive
This commit is contained in:
david parsons
2011-07-13 10:56:24 -07:00
parent f74081b150
commit d4ea79f47a
+6 -2
View File
@@ -37,6 +37,8 @@ char *pgm = "theme";
char *output = 0;
char *pagename = 0;
char *root = 0;
int everywhere = 0; /* expand all <?theme elements everywhere */
#if HAVE_PWD_H
struct passwd *me = 0;
#endif
@@ -466,7 +468,7 @@ spin(FILE *template, MMIOT *doc, FILE *output)
for (i=0; i < NR(keyword); i++)
if ( thesame(p, keyword[i].kw) ) {
if ( keyword[i].where & where )
if ( everywhere || (keyword[i].where & where) )
(*keyword[i].what)(doc,output,flags,where);
break;
}
@@ -512,10 +514,12 @@ char **argv;
opterr=1;
pgm = basename(argv[0]);
while ( (opt=getopt(argc, argv, "fd:t:p:o:V")) != EOF ) {
while ( (opt=getopt(argc, argv, "Efd:t:p:o:V")) != EOF ) {
switch (opt) {
case 'd': root = optarg;
break;
case 'E': everywhere = 1;
break;
case 'p': pagename = optarg;
break;
case 'f': force = 1;