Merge branch 'dev' of feistymeow.org:feisty_meow into dev
[feisty_meow.git] / nucleus / tools / clam_tools / version_stamper.cpp
index a668a9f0bf8316648dfabeb45bc3653a766b41b0..3313906d82f90b50343b49cfa44413f470ab49a0 100644 (file)
@@ -65,26 +65,29 @@ version_stamper::~version_stamper() {}
 
 int version_stamper::execute()
 {
-///  FUNCDEF("execute");
+  FUNCDEF("execute");
   SETUP_CONSOLE_LOGGER;  // override the file_logger from app_shell.
-  if (application::_global_argc < 2) {
-    log(astring("The directory where the 'version.ini' file is located\n"
-        "must be specified as the first parameter of this program.  Another\n"
-        "version file may optionally be specified as the second parameter of\n"
-        "the program; the version contained in this file will be used to set\n"
-        "the version of the file specified in the first parameter.\n"
-        "Additionally, if the environment variable 'DEBUG' exists, then the\n"
-        "generated RC file will be marked as a debug build.  Otherwise it is\n"
-        "marked as a release build.  Note that the CLAM system automatically\n"
-        "sets this for you.\n\n"), ALWAYS_PRINT);
+  if (application::_global_argc < 3) {
+    log(astring(
+"The directory where the 'version.ini' file is located must be specified as the\n"
+"first parameter of this program.  The second parameter must provide the\n"
+"storage location where the version header will be written.  Another version\n"
+"file may optionally be specified as the third parameter of the program; the\n"
+"version contained in this file will be used to set the version of the file\n"
+"specified in the first parameter.\n"
+"Additionally, if the environment variable 'DEBUG' exists, then the\n"
+"generated RC file will be marked as a debug build.  Otherwise it is\n"
+"marked as a release build.  Note that the CLAM system automatically\n"
+"sets this for you.\n\n"), ALWAYS_PRINT);
     return 1;
   }
 
   astring path_name = application::_global_argv[1];
+  astring storage_name = application::_global_argv[2];
   astring source_version_file;  // blank by default.
-  if (application::_global_argc > 2)
-    source_version_file = application::_global_argv[2];
-  bool ret = version_ini::one_stop_version_stamp(path_name, source_version_file, true);
+  if (application::_global_argc > 3)
+    source_version_file = application::_global_argv[3];
+  bool ret = version_ini::one_stop_version_stamp(path_name, storage_name, source_version_file, true);
   if (!ret) return 1;  // failure.
   return 0;  // success.
 }
@@ -95,9 +98,11 @@ HOOPLE_MAIN(version_stamper, )
   // static dependencies found by buildor_gen_deps.sh:
   #include <application/application_shell.cpp>
   #include <application/command_line.cpp>
+  #include <application/windoze_helper.cpp>
   #include <basis/astring.cpp>
   #include <basis/common_outcomes.cpp>
   #include <basis/environment.cpp>
+  #include <basis/guards.cpp>
   #include <basis/mutex.cpp>
   #include <basis/utf_conversion.cpp>
   #include <configuration/application_configuration.cpp>