Changeset 11403


Ignore:
Timestamp:
07/14/11 09:01:17 (13 years ago)
Author:
tbretz
Message:
Use Vec instead of Get and make sure 'console' is not accessed if not available.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/dimctrl.cc

    r11327 r11403  
    1818            win << kRed << "ERROR - Couldn't open log-file " << conf.Get<string>("log") << ": " << strerror(errno) << endl;
    1919
    20     if (conf.Has("cmd"))
    21     {
    22         const vector<string> v = conf.Get<vector<string>>("cmd");
    23         for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
    24             shell.ProcessLine(*it);
    25     }
     20    const vector<string> v1 = conf.Vec<string>("cmd");
     21    for (vector<string>::const_iterator it=v1.begin(); it!=v1.end(); it++)
     22        shell.ProcessLine(*it);
    2623
    27     if (conf.Has("exec"))
    28     {
    29         const vector<string> v = conf.Get<vector<string>>("exec");
    30         for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
    31             shell.Execute(*it);
    32     }
     24    const vector<string> v2 = conf.Vec<string>("exec");
     25    for (vector<string>::const_iterator it=v2.begin(); it!=v2.end(); it++)
     26        shell.Execute(*it);
    3327
    3428    if (conf.Get<bool>("quit"))
     
    4842        ("dns",       var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
    4943        ("log,l",     var<string>(n), "Write log-file")
    50         ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
     44        ("console,c", var<int>(0),    "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
    5145        ("cmd",       vars<string>(), "Execute one or more commands at startup")
    5246        ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
     
    122116
    123117    if (conf.Get<int>("console")==0)
     118        //Main<RemoteShell, DummyService>(conf);
    124119        RunShell<RemoteShell>(conf);
    125120    else
     121        //Main<RemoteConsole, DummyService>(conf);
    126122        RunShell<RemoteConsole>(conf);
    127123
Note: See TracChangeset for help on using the changeset viewer.