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/fscctrl.cc

    r11115 r11218  
    584584    // boost::thread t(boost::bind(&StateMachineFSC<S>::Run, &io_service));
    585585
     586    if (conf.Has("cmd"))
     587    {
     588        const vector<string> v = conf.Get<vector<string>>("cmd");
     589        for (vector<string>::const_iterator it=v.begin(); it!=v.end(); it++)
     590            shell.ProcessLine(*it);
     591    }
     592
    586593    if (conf.Has("exec"))
    587594    {
     
    590597            shell.Execute(*it);
    591598    }
     599
     600    if (conf.Get<bool>("quit"))
     601        shell.Stop();
    592602
    593603    shell.Run();                 // Run the shell
     
    613623        ("no-dim,d",  po_bool(),      "Disable dim services")
    614624        ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
     625        ("cmd",       vars<string>(), "Execute one or more commands at startup")
    615626        ("exec,e",    vars<string>(), "Execute one or more scrips at startup")
     627        ("quit,q",    po_switch(),    "Quit after startup");
    616628        ;
    617629
Note: See TracChangeset for help on using the changeset viewer.