ssic: Set __SSIC__ SSI variable.
[ssic.git] / bin / ssic
index ea0a838cc90dfb1aac2dff889e7e5e541c2d7f4e..8e5695b0077f5dd8f2738699680f2049f5310a57 100755 (executable)
--- a/bin/ssic
+++ b/bin/ssic
@@ -12,6 +12,9 @@ use warnings;
 use Getopt::Long;
 use CGI::SSI;
 
+my $VERSION;
+$VERSION = '1.0.0';
+
 sub main
 {
        my %opts;
@@ -78,9 +81,9 @@ sub help
 
        usage($fh);
        print("Options:\n");
-       print("  -D <name>=<value>  Set the variable <name> to <value>\n");
-       print("  -I <directory>     Set the document root to <directory>\n");
        print("  -o <output>        Place the output into <output>\n");
+       print("  -I <directory>     Set the document root to <directory>\n");
+       print("  -D <name>=<value>  Set the variable <name> to <value>\n");
        print("  -h, --help         Display this information\n");
        print("  -V, --version      Display compiler version information\n");
 }
@@ -89,7 +92,7 @@ sub version
 {
        my ($fh) = @_;
 
-       print("ssic 0.1.0\n");
+       printf("ssic %s\n", $VERSION);
        print("Copyright (C) 2013 Patrick \"P. J.\" McDermott\n");
        print("License GPLv3+: GNU GPL version 3 or later " .
                "<http://gnu.org/licenses/gpl.html>.\n");
@@ -127,6 +130,7 @@ sub init_compiler
        $CGI::SSI::DEBUG = 0;
        $ssi = CGI::SSI->new();
 
+       $ssi->set("__SSIC__" => 1);
        $ssi->set("DOCUMENT_ROOT" => $root);
 
        while (($var_name, $var_value) = each(%{$vars})) {