Changeset 980 for trunk/test


Ignore:
Timestamp:
Oct 22, 2007, 2:55:19 AM (15 years ago)
Author:
Peter
Message:

adding possibility to make option required

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/commandline_test.cc

    r979 r980  
    340340    }
    341341  }
     342
     343
     344  error << "Testing OptionArg required ...";
     345  {
     346    OptionArg<std::string> required(cmd, "required", "required", true);
     347    int ac = 1;
     348    char* av[] = { "test_prog" };
     349    try{
     350      cmd.parse(ac,av);
     351      error << "failed\n";
     352      ok =false;
     353    }
     354    catch (...) {
     355      error << "ok\n";
     356    }
     357  }
     358
     359
    342360  return ok;
    343361}
Note: See TracChangeset for help on using the changeset viewer.