Skip to content

Commit 937d557

Browse files
authored
Merge pull request #4195 from NlightNFotis/goto-instrument-error-handling
Better goto-instrument error reporting for missing files
2 parents 6406ee1 + fd5b9c0 commit 937d557

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Author: Daniel Kroening, [email protected]
1616
#include <memory>
1717

1818
#include <util/config.h>
19+
#include <util/exception_utils.h>
1920
#include <util/exit_codes.h>
2021
#include <util/json.h>
2122
#include <util/string2int.h>
@@ -824,6 +825,14 @@ int goto_instrument_parse_optionst::doit()
824825
else
825826
return CPROVER_EXIT_SUCCESS;
826827
}
828+
else if(cmdline.args.size() < 2)
829+
{
830+
throw invalid_command_line_argument_exceptiont(
831+
"Invalid number of positional arguments passed",
832+
"[in] [out]",
833+
"goto-instrument needs one input and one output file, aside from other "
834+
"flags");
835+
}
827836

828837
help();
829838
return CPROVER_EXIT_USAGE_ERROR;

0 commit comments

Comments
 (0)