Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#508 closed defect (fixed)

Commandline throws exception without message

Reported by: Peter Owned by: Peter
Priority: minor Milestone: yat 0.5.2
Component: utility Version: 0.5.1
Keywords: Cc:

Description

I have application using the CommandLine. When calling the application with an option not available, CommandLine throws as expected but there is no message in the exception.

Below follows my code:

yat::utility::CommandLine cmd;
yat::utility::OptionHelp help(cmd, "h,help", "");
yat::utility::OptionFile indata(cmd, "i,in", "input file", true, true,"r");
yat::utility::OptionSwitch cmd_memory(cmd, "m", "transpose in a memory cheap manner");
yat::utility::OptionArg<size_t> cmd_n(cmd, "n", "number of rows to print in each iteration");
yat::utility::OptionSwitch cmd_numeric(cmd, "numeric", "input is a numeric matrix");
yat::utility::OptionFile outdata(cmd, "o,out", "output file",true, false,"w");
yat::utility::OptionSwitch verbose(cmd, "v,verbose", "display progress");

try {
cmd.parse(argc, argv);
}
catch (yat::utility::cmd_error& e){
std::cerr << e.what() << std::endl;
exit(-1);
}

Change History (3)

comment:1 Changed 12 years ago by Peter

(In [1868]) refs #508. adding a test for the bug.

comment:2 Changed 12 years ago by Peter

Resolution: fixed
Status: newclosed

(In [1869]) fixes #508

comment:3 Changed 9 years ago by Peter

(In [2705]) make sure test catches possible regression (refs #508)

Note: See TracTickets for help on using tickets.