diff --git a/tconfpy.3 b/tconfpy.3 index deee177..66adbf9 100644 --- a/tconfpy.3 +++ b/tconfpy.3 @@ -1792,7 +1792,7 @@ Each has the same syntax: .nf - ExistentialDirective [var] ... + ExistentialDirective varname ... included if True .else # optional @@ -1802,7 +1802,7 @@ .fi In other words, existential conditionals require -.B one or more variable references. +.B one or more variable names. In each case, the actual content of that variable is ignored. The test is merely checking to see .B if a variable by that name exists. @@ -1813,17 +1813,17 @@ logic: .nf - .ifall [var1] [var2] ... + .ifall var1 var2 ... This is a logical "AND" operation. ALL of the variables, \'var1\', \'var2\' ... must exist for this test to be True. - .ifany [var1] [var2] ... + .ifany var1 var2 ... This is a logical "OR" operation. It is True of ANY of the variables, \'var1\', \'var2\' ... exist. - .ifall [var1] [var2] ... + .ifall var1 var2 ... This is a logical "NOR" operation. It is True only if NONE of the variables, \'var1\', \'var2\' ... exist. @@ -1836,15 +1836,15 @@ BAR = 2 z = 0 - .ifall [FOO] [BAR] + .ifall FOO BAR x = 1 .endif - .ifany [FOO] [foo] [fOo] + .ifany FOO foo fOo y = 2 .endif - .ifnone [BAR] [bar] [Bar] [SOmething] + .ifnone BAR bar Bar SOmething z=3 .endif .fi @@ -1855,8 +1855,8 @@ conditional test: .nf - .ifany [$MYPROGOPTIONS] - options = [$MYPROGOPTIONS] + .ifany $MYPROGOPTIONS + options = $MYPROGOPTIONS .else options = -b20 -c23 -z -r @@ -1864,6 +1864,38 @@ .endif .fi +You can also use variable references here to get the name of a varible +to test by "indirection" (as we saw in the previous section on +accessing/setting variables indirectly. This is not a recommended +way of doing things because it can be kind of obscure to understand, +but it is possible to do this: + +.nf + + foo = MyVarName + + .ifany [FOO] + ... + .endif +.fi + +This will test to see if either the variable \'MyVarName\' exists. +You can also do indirection through an environment variable, but +this is +.B really +not recommended because of the obscurity it introduces into a +configuration file. Say, $TERM is set to \'vt100\': + +.nf + .ifany [$TERM] + ... + .endif +.fi + +This will test to see if a variable called \'vt100\' exists in the +symbol table. Perhaps, not the clearest possible construct! + + .SS Comparison Conditional Directives There are two Comparison Conditionals: