Improve error message generated when calling argument() incorrectly.

This commit is contained in:
Davis King 2014-04-23 19:19:49 -04:00
parent 99342ca5be
commit 81a04634ed
1 changed files with 7 additions and 6 deletions

View File

@ -169,12 +169,13 @@ namespace dlib
// make sure requires clause is not broken
DLIB_CASSERT( N < count() && arg < number_of_arguments(),
"\tconst string_type& cmd_line_parser_option::argument(unsigned long,unsigned long)"
<< "\n\tsee the requires clause of argument()"
<< "\n\tthis: " << this
<< "\n\tN: " << N
<< "\n\targ: " << arg
<< "\n\tcount(): " << count()
<< "\n\tnumber_of_arguments(): " << number_of_arguments()
<< "\n\tInvalid arguments were given to this function."
<< "\n\tthis: " << this
<< "\n\tN: " << N
<< "\n\targ: " << arg
<< "\n\tname(): " << narrow(name())
<< "\n\tcount(): " << count()
<< "\n\tnumber_of_arguments(): " << number_of_arguments()
);
return options[N][arg];