Changeset 55ebd0 for molecuilder/src


Ignore:
Timestamp:
Sep 11, 2008, 1:08:18 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
4917ddd
Parents:
8e52aa
git-author:
Frederik Heber <heber@…> (09/11/08 13:02:14)
git-committer:
Frederik Heber <heber@…> (09/11/08 13:08:18)
Message:

ParseCommandLineOptions(): Command line option "-E" for changing an atom's element, BUGFIX: argptr could become >argc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/builder.cpp

    r8e52aa r55ebd0  
    812812            cout << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl;
    813813            cout << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl;
     814            cout << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl;
    814815            cout << "\t-f/F <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl;
    815816            cout << "\t-h/-H/-?\tGive this help screen." << endl;
     
    966967              argptr+=1;
    967968              break;
    968             case 'L':
     969            case 'E':
     970              ExitFlag = 1;
     971              SaveFlag = true;
     972              cout << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl;
     973              first = mol->FindAtom(atoi(argv[argptr]));
     974              first->type = periode->FindElement(atoi(argv[argptr+1]));
     975              argptr+=2;
     976              break;
     977            case 'T':
    969978              ExitFlag = 1;
    970979              {
     
    11851194              break;
    11861195            default:   // no match? Step on
    1187               if (argv[argptr][0] != '-') // if it started with a '-' we've already made a step!
     1196              if ((argptr < argc) && (argv[argptr][0] != '-')) // if it started with a '-' we've already made a step!
    11881197                argptr++;
    11891198              break;
Note: See TracChangeset for help on using the changeset viewer.