Changeset 10798


Ignore:
Timestamp:
May 24, 2011, 5:38:02 PM (8 years ago)
Author:
tbretz
Message:
Simplified program options handling.
File:
1 edited

Legend:

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

    r10784 r10798  
    1111#include <boost/asio/deadline_timer.hpp>
    1212
    13 #include "FACT.h"
    1413#include "Dim.h"
    1514#include "Event.h"
     
    7574            return;
    7675
    77         Out() << endl << kBold << "Channel " << i << " received:" << endl;
    7876        Out() << fChannelHeader[i];
    7977        if (fIsHexOutput)
     
    9593        {
    9694            if (err==ba::error::eof)
    97                 Warn("Connection closed by remote host (FTM).");
     95                Warn("Connection closed by remote host (FAD).");
    9896
    9997            // 107: Transport endpoint is not connected (bs::error_code(107, bs::system_category))
     
    11591157            const int &idx = i->first;
    11601158
    1161             // FIXME: There is a difference between
    1162             //        "connecting" and "disconnected"
    1163 
    1164             // Check conistency eb/fadctrl
    1165 
    11661159            // ----- Command socket -----
    11671160            if (c.IsConnecting())
     
    12001193
    12011194        // ===== Return connection status =====
     1195
     1196        // fadctrl:       Always connecting if not disabled
     1197        // event builder:
    12021198
    12031199        if (nconnected1==fBoards.size() && nconnected2==fBoards.size())
     
    15441540        ;
    15451541
    1546     po::options_description control("FTM control options");
     1542    po::options_description control("FAD control options");
    15471543    control.add_options()
    15481544//        ("addr,a",        var<string>("localhost:5000"),  "Network address of FTM")
     
    15841580{
    15851581    Configuration conf(argv[0]);
     1582    conf.SetPrintUsage(PrintUsage);
    15861583    SetupConfiguration(conf);
    15871584
     
    15941591    catch (po::multiple_occurrences &e)
    15951592    {
    1596         cout << "Error: " << e.what() << " of '" << e.get_option_name() << "' option." << endl;
    1597         cout << endl;
     1593        cerr << "Program options invalid due to: " << e.what() << " of '" << e.get_option_name() << "'." << endl;
    15981594        return -1;
    15991595    }
    16001596#endif
    1601     catch (std::exception &e)
    1602     {
    1603         cout << "Error: " << e.what() << endl;
    1604         cout << endl;
    1605 
     1597    catch (exception& e)
     1598    {
     1599        cerr << "Program options invalid due to: " << e.what() << endl;
    16061600        return -1;
    16071601    }
    16081602
    1609     if (conf.HasPrint())
     1603    if (conf.HasVersion() || conf.HasPrint())
    16101604        return -1;
    1611 
    1612     if (conf.HasVersion())
    1613     {
    1614         FACT::PrintVersion(argv[0]);
    1615         return -1;
    1616     }
    16171605
    16181606    if (conf.HasHelp())
Note: See TracChangeset for help on using the changeset viewer.