Changes in src/builder.cpp [4eb4fe:99fcaf]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/builder.cpp
r4eb4fe r99fcaf 1494 1494 */ 1495 1495 static int ParseCommandLineOptions(int argc, char **argv, MoleculeListClass *&molecules, periodentafel *&periode, 1496 config& configuration, char *&ConfigFileName, set<int> &ArgcList)1496 config& configuration, char *&ConfigFileName, list<int> &ArgcList) 1497 1497 { 1498 1498 Vector x,y,z,n; // coordinates for absolute point in cell volume … … 1525 1525 case 'H': 1526 1526 case '?': 1527 ArgcList. insert(argptr-1);1527 ArgcList.push_back(argptr-1); 1528 1528 return(1); 1529 1529 break; 1530 1530 case 'v': 1531 ArgcList. insert(argptr-1);1531 ArgcList.push_back(argptr-1); 1532 1532 return(1); 1533 1533 break; 1534 1534 case 'V': 1535 ArgcList. insert(argptr-1);1536 ArgcList. insert(argptr);1535 ArgcList.push_back(argptr-1); 1536 ArgcList.push_back(argptr); 1537 1537 argptr++; 1538 1538 break; … … 2499 2499 char **Arguments = NULL; 2500 2500 int ArgcSize = 0; 2501 int ExitFlag = 0; 2501 2502 bool ArgumentsCopied = false; 2502 2503 2503 // print version check whether arguments are present at all2504 2504 cout << ESPACKVersion << endl; 2505 if (argc < 2) {2506 cout << "Obtain help with " << argv[0] << " -h." << endl;2507 return(1);2508 }2509 2510 2505 2511 2506 setVerbosity(0); … … 2515 2510 // Parse command line options and if present create respective UI 2516 2511 { 2517 set<int> ArgcList;2518 ArgcList. insert(0); // push back program!2519 ArgcList. insert(1); // push back config file name2512 list<int> ArgcList; 2513 ArgcList.push_back(0); // push back program! 2514 ArgcList.push_back(1); // push back config file name 2520 2515 char ConfigFileName[MAXSTRINGSIZE]; 2521 2516 // handle arguments by ParseCommandLineOptions() 2522 ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), (char *&)ConfigFileName, ArgcList);2517 ExitFlag = ParseCommandLineOptions(argc,argv,World::getInstance().getMolecules(),World::getInstance().getPeriode(),*World::getInstance().getConfig(), (char *&)ConfigFileName, ArgcList); 2523 2518 // copy all remaining arguments to a new argv 2524 2519 Arguments = Malloc<char *>(ArgcList.size(), "main - **Arguments"); 2525 2520 cout << "The following arguments are handled by CommandLineParser: "; 2526 for ( set<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) {2521 for (list<int>::iterator ArgcRunner = ArgcList.begin(); ArgcRunner != ArgcList.end(); ++ArgcRunner) { 2527 2522 Arguments[ArgcSize] = Malloc<char>(strlen(argv[*ArgcRunner])+2, "main - *Arguments[]"); 2528 2523 strcpy(Arguments[ArgcSize], argv[*ArgcRunner]); … … 2565 2560 cleanUp(); 2566 2561 Memory::getState(); 2567 return ( 0);2562 return (ExitFlag == 1 ? 0 : ExitFlag); 2568 2563 } 2569 2564
Note:
See TracChangeset
for help on using the changeset viewer.