src/main.cpp

changeset 140
04a6eb68f226
parent 139
cf11621ae422
child 141
68d60e2cfa76
equal deleted inserted replaced
139:cf11621ae422 140:04a6eb68f226
35 #include "lexer.h" 35 #include "lexer.h"
36 #include "hginfo.h" 36 #include "hginfo.h"
37 #include "commandline.h" 37 #include "commandline.h"
38 #include "enumstrings.h" 38 #include "enumstrings.h"
39 39
40 #ifdef SVN_REVISION_STRING
41 #define FULL_VERSION_STRING VERSION_STRING "-" SVN_REVISION_STRING;
42 #else
43 #define FULL_VERSION_STRING VERSION_STRING;
44 #endif
45
40 int main (int argc, char** argv) 46 int main (int argc, char** argv)
41 { 47 {
42 try 48 try
43 { 49 {
44 Verbosity verboselevel = Verbosity::None; 50 Verbosity verboselevel = Verbosity::None;
64 } 70 }
65 71
66 if (not within (args.size(), 1, 2)) 72 if (not within (args.size(), 1, 2))
67 { 73 {
68 // Print header 74 // Print header
69 String header; 75 String header = APPNAME " " FULL_VERSION_STRING;
70 header = format (APPNAME " %1", versionString (true));
71
72 #ifdef DEBUG 76 #ifdef DEBUG
73 header += " (debug build)"; 77 header += " (debug build)";
74 #endif 78 #endif
75 79
76 printTo (stderr, "%1\n", header); 80 printTo (stderr, "%1\n", header);
176 return ver; 180 return ver;
177 } 181 }
178 182
179 // _________________________________________________________________________________________________ 183 // _________________________________________________________________________________________________
180 // 184 //
181 String versionString (bool longform) 185 String versionString()
182 { 186 {
183 String result = makeVersionString (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); 187 return VERSION_STRING;
184
185 #ifdef SVN_REVISION_STRING
186 if (longform)
187 result += "-" SVN_REVISION_STRING;
188 #else
189 (void) longform; // shuts up GCC
190 #endif
191
192 return result;
193 } 188 }

mercurial