Ignore:
Timestamp:
06/29/11 23:08:38 (13 years ago)
Author:
tbretz
Message:
Added --cmd and --quit program option.
File:
1 edited

Legend:

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

    r11089 r11218  
    25262526
    25272527    boost::thread t(boost::bind(RunThread, &logger));
     2528
     2529    if (conf.Has("cmd"))
     2530    {
     2531        const vector<string> v = conf.Get<vector<string>>("cmd");
     2532        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
     2533            shell.ProcessLine(*it);
     2534    }
     2535
     2536    if (conf.Has("exec"))
     2537    {
     2538        const vector<string> v = conf.Get<vector<string>>("exec");
     2539        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
     2540            shell.Execute(*it);
     2541    }
     2542
     2543    if (conf.Get<bool>("quit"))
     2544        shell.Stop();
     2545
    25282546   
    25292547    shell.Run(); // Run the shell
     
    25942612        ("log,l",     var<string>(n), "Write log-file")
    25952613        ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
     2614        ("cmd",       vars<string>(), "Execute one or more commands at startup")
     2615        ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
     2616        ("quit,q",    po_switch(),    "Quit after startup");
    25962617        ;
    25972618
Note: See TracChangeset for help on using the changeset viewer.