Changeset 11216


Ignore:
Timestamp:
06/29/11 22:59:07 (13 years ago)
Author:
tbretz
Message:
Added cmd and quit command.
File:
1 edited

Legend:

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

    r11056 r11216  
    784784    boost::thread t(boost::bind(RunThread, &io_service));
    785785
     786    if (conf.Has("cmd"))
     787    {
     788        const vector<string> v = conf.Get<vector<string>>("cmd");
     789        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
     790            shell.ProcessLine(*it);
     791    }
     792
    786793    //io_service.SetReady();
    787794    if (conf.Has("exec"))
     
    791798            shell.Execute(*it);
    792799    }
     800
     801    if (conf.Get<bool>("quit"))
     802        shell.Stop();
    793803
    794804    shell.Run();                 // Run the shell
     
    816826        ("no-dim,d",  po_switch(),    "Disable dim services")
    817827        ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
    818         ("exec,e",    vars<string>(), "Execute one or more scrips at startup");
     828        ("cmd",       vars<string>(), "Execute one or more commands at startup")
     829        ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
     830        ("quit,q",    po_switch(),    "Quit after startup");
    819831
    820832    po::options_description control("Scheduler options");
Note: See TracChangeset for help on using the changeset viewer.