#include "arg.ih"

namespace
{
    char const argData[] = "Arg:: ";
}

void Arg__::verify()
{
    switch (d_optionType)
    {
        case OK:
        return;

        case NO_OPTION:
        throw Exception{} << argData << "unknown option: " << d_nextChar;

        case NO_LONG_OPTION:
        throw Exception{} << argData << "no LongOption `" << *d_arg << 
                                                        "' defined";
        case NO_SHORTOPT:
        throw Exception{} << argData << d_longOpt << ": no short option '" <<
                                                        d_nextChar << '\'';
        case NO_ARGUMENT:
        throw Exception{} << argData << "missing value for option: " << 
                                                        d_nextChar;
        case NO_LONG_ARGUMENT:
        throw Exception{} << argData << "missing value for long option `" << 
                                                        d_option;
        case PLAIN_LONG_OPTION:
        throw Exception{} << argData << "LongOption `" << d_option << 
                                                    "' cannot handle values";
        case MULTI_LONG:
        throw Exception{} << argData << "LongOption `" << d_longOpt << 
                                                        "' multiply defined";
    }
}


