Changeset 0e348e for molecuilder/src


Ignore:
Timestamp:
May 16, 2008, 1:35:43 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
e9c14d
Parents:
cc6dfb
Message:

main(): typo in Usage message, BUGFIX - command line arguments did not end in exit and flag renamed to ExitFlag

BUGFIX - problem was flag > 1 instead of flag >= 1 check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    rcc6dfb r0e348e  
    717717  char *ConfigFileName = NULL;
    718718  char *ElementsFileName = NULL;
    719   int flag = 0;
     719  int ExitFlag = 0;
    720720  int Z;
    721721  int j, axis, count, faktor;
     
    746746            cout << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl;
    747747            cout << "\t-e <file>\tSets the element database to be parsed from this file (default: elements.db in same dir as " << argv[0] << ")." << endl;
    748             cout << "\t-e <dist> <order>\tFragments the molecule in BOSSANOVA manner and stores config files in same dir as config." << endl;
     748            cout << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner and stores config files in same dir as config." << endl;
    749749            cout << "\t-h/-H/-?\tGive this help screen." << endl;
    750750            cout << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl;
     
    832832          switch(argv[argptr-1][1]) {
    833833            case 'p':
    834               flag = 1;
     834              ExitFlag = 1;
    835835              cout << Verbose(1) << "Parsing xyz file for new atoms." << endl;
    836836              if (!mol->AddXYZFile(argv[argptr++]))
     
    848848            switch(argv[argptr-1][1]) {
    849849              case 't':
    850                 flag = 1;
     850                ExitFlag = 1;
    851851                cout << Verbose(1) << "Translating all ions to new origin." << endl;
    852852                for (int i=0;i<3;i++)
     
    856856                break;
    857857              case 'a':
    858                 flag = 1;
     858                ExitFlag = 1;
    859859                cout << Verbose(1) << "Adding new atom." << endl;
    860860                first = new atom;
     
    873873                break;
    874874              case 's':
    875                 flag = 1;
     875                ExitFlag = 1;
    876876                j = -1;
    877877                cout << Verbose(1) << "Scaling all ion positions by factor." << endl;
     
    894894                break;
    895895              case 'c':
    896                 flag = 1;
     896                ExitFlag = 1;
    897897                j = -1;
    898898                cout << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl;
     
    911911                break;
    912912              case 'r':
    913                 flag = 1;
     913                ExitFlag = 1;
    914914                cout << Verbose(1) << "Converting config file from supposed old to new syntax." << endl;
    915915                break;
    916916              case 'f':
    917                 if (flag ==0) flag = 2;  // only set if not already by other command line switch
     917                if (ExitFlag ==0) ExitFlag = 2;  // only set if not already by other command line switch
    918918                cout << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl;
    919919                if (argc >= argptr+2) {
     
    940940          } else argptr++;
    941941        } while (argptr < argc);
    942     if (flag == 1) // 1 means save and exit
     942    if (ExitFlag == 1) // 1 means save and exit
    943943      SaveConfig(ConfigFileName, &configuration, periode, mol);
    944     if (flag > 1) { // 2 means just exit
     944    if (ExitFlag >= 1) { // 2 means just exit
    945945      delete(mol);
    946946      delete(periode);
     
    11021102       
    11031103      case 'c': // unit scaling of the metric
     1104       cout << Verbose(0) << "Angstroem -> Bohrradius: 1.8897261\t\tBohrradius -> Angstroem: 0.52917721" << endl;
    11041105         cout << Verbose(0) << "Enter three factors: ";
    11051106       factor = (double *) Malloc(sizeof(double)*NDIM, "main: *factor");
Note: See TracChangeset for help on using the changeset viewer.