#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); }
Note: See
TracTickets for help on using
tickets.
(In [1868]) refs #508. adding a test for the bug.