@@ -21,13 +21,13 @@ int goto_inspect_parse_optionst::doit()
21
21
return CPROVER_EXIT_SUCCESS;
22
22
}
23
23
24
- // Before we do anything else, positional arguments needs to be > 1 .
25
- // (i.e. a filename has been given).
26
- if (cmdline.args .size () < 1 )
24
+ // Before we do anything else, ensure that positional + optional arguments > 2 .
25
+ // (i.e. a filename and an inspection option has been given).
26
+ if (cmdline.args .size () < 2 )
27
27
{
28
28
help ();
29
29
throw invalid_command_line_argument_exceptiont{
30
- " failed to supply a goto-binary name" ,
30
+ " failed to supply a goto-binary name or an option for inspection " ,
31
31
" <input goto-binary> <inspection-option>" };
32
32
}
33
33
@@ -63,7 +63,13 @@ int goto_inspect_parse_optionst::doit()
63
63
return CPROVER_EXIT_SUCCESS;
64
64
}
65
65
66
- // No options was passed in - erroneously?
66
+ // If an option + binary was provided, the program will have exited gracefully
67
+ // through a different branch. If we hit the code below, it means that something
68
+ // has gone wrong - normally both the happy and the error paths should be handled
69
+ // through the dispatching if blocks above, but we need a return statement to
70
+ // satisfy the compiler and the signature of `doit()`, hence why we have this
71
+ // here as a dummy return value that attempts to be somewhat semantically relevant
72
+ // and consistent to the behaviour of other tools.
67
73
return CPROVER_EXIT_INCORRECT_TASK;
68
74
}
69
75
0 commit comments