Ignore:
Timestamp:
Feb 27, 2008, 8:24:31 PM (14 years ago)
Author:
Peter
Message:

fixes #344

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/OptionArg.h

    r1125 r1178  
    2727#include "Option.h"
    2828#include "CommandLine.h"
     29#include "Exception.h"
    2930
    30 #include <stdexcept>
    3131#include <string>
    3232#include <sstream>
     
    8787        ss << "option requires an argument -- " << short_name() << "\n"
    8888           << cmd().try_help();
    89         throw std::runtime_error(ss.str());
     89        throw cmd_error(ss.str());
    9090      }
    9191      if (first+1==last ) {
     
    9494          ss << "option `--" << long_name() << "' requires an argument\n"
    9595             << cmd().try_help();
    96           throw std::runtime_error(ss.str());
     96          throw cmd_error(ss.str());
    9797        }
    9898        else {
     
    100100          ss << "option requires an argument -- " << short_name() << "\n"
    101101             << cmd().try_help();
    102           throw std::runtime_error(ss.str());
     102          throw cmd_error(ss.str());
    103103        }
    104104      }       
     
    125125        std::stringstream sstr(rhs);
    126126        sstr << ": invalid argument";
    127         throw std::runtime_error(sstr.str());
     127        throw cmd_error(sstr.str());
    128128      }
    129129    }
     
    142142        ss << "' not given\n";
    143143        ss << cmd().try_help();
    144         throw std::runtime_error(ss.str());
     144        throw cmd_error(ss.str());
    145145      }
    146146      do_validate2();
Note: See TracChangeset for help on using the changeset viewer.