Skip to content

Better goto-instrument error reporting for missing files #4195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/goto-instrument/goto_instrument_parse_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Author: Daniel Kroening, [email protected]
#include <memory>

#include <util/config.h>
#include <util/exception_utils.h>
#include <util/exit_codes.h>
#include <util/json.h>
#include <util/string2int.h>
Expand Down Expand Up @@ -824,6 +825,14 @@ int goto_instrument_parse_optionst::doit()
else
return CPROVER_EXIT_SUCCESS;
}
else if(cmdline.args.size() < 2)
{
throw invalid_command_line_argument_exceptiont(
"Invalid number of positional arguments passed",
"[in] [out]",
"goto-instrument needs one input and one output file, aside from other "
"flags");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also maybe add an additional line here to say "use goto-instrument --help for additional help" or something similar.

}

help();
return CPROVER_EXIT_USAGE_ERROR;
Expand Down