+ addComOption("lsize", required_argument, NULL, 'L', "define lattice size", "xsize:tsize");
+ addComOption("nmeas", required_argument, NULL, 'N', "set number of measurements", "nmeas");
+ addComOption("skip", required_argument, NULL, 'S', "set number of skips between configs", "nskip");
+ addComOption("nequi", required_argument, NULL, 'E', "set number of equilibrations", "nequi");
+ addComOption("oro", required_argument, NULL, 'o', "read-only observable-store directory", "dir");
+ addComOption("orw", required_argument, NULL, 'O', "read-write observable-store directory", "dir");
+ addComOption("cro", required_argument, NULL, 'c', "read-only config-store directory", "dir");
+ addComOption("crw", required_argument, NULL, 'C', "read-write config-store directory", "dir");
+ addComOption("write", required_argument, NULL, 'w', "data writeout directory", "dir");
+ addComOption("idonly", no_argument, &comargs.idonly, 'i', "show output-id only", "");
+ addComOption("jobnum", no_argument, &comargs.showjobnum, 'j', "show jobnumber only", "");
+
+ if (specOps != NULL)
+ for (int ispecop = 0; specOps[ispecop].name != ""; ispecop++)
+ comOptions.push_back(specOps[ispecop]);
+
+ if (argc > 1)
+ parseArgs(argc, argv, specOps);
+ else {
+ int longestCombinedLong=0;
+
+ if (helpHeader != NULL)
+ helpHeader();
+
+ cout << "Options:" << endl;
+
+ for (vector<comoption>::iterator opit = comOptions.begin(); opit != comOptions.end(); ++opit) {
+ stringstream combinedLong;
+
+ combinedLong << opit->name;
+ if (opit->has_arg == required_argument)
+ combinedLong << "=" << opit->argdesc;
+ else if (opit->has_arg == optional_argument)
+ combinedLong << "[=" << opit->argdesc << "]";
+
+ if (longestCombinedLong < combinedLong.str().size())
+ longestCombinedLong = combinedLong.str().size();
+ }
+
+ for (vector<comoption>::iterator opit = comOptions.begin(); opit != comOptions.end(); ++opit) {
+ stringstream combinedLong;
+
+ cout << " -" << char(opit->val) << ", --";
+
+ combinedLong << opit->name;
+ if (opit->has_arg == required_argument)
+ combinedLong << "=" << opit->argdesc;
+ else if (opit->has_arg == optional_argument)
+ combinedLong << "[=" << opit->argdesc << "]";
+
+ cout << setw(longestCombinedLong) << setiosflags(ios::left) << combinedLong.str();
+
+ cout << "\t" << opit->optdesc;
+
+ cout << endl;
+ }
+ exit(0);
+ }
+