@@ -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,14 @@ 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 different a different branch. If we hit the code below, it means
68
+ // that something has gone wrong - normally both the happy and the error paths
69
+ // should be handled through the dispatching if blocks above, but we need a
70
+ // return statement to satisfy the compiler and the signature of `doit()`,
71
+ // hence why we have this here as a dummy return value that attempts to be
72
+ // somewhat semantically relevant and consistent to the behaviour of other
73
+ // tools.
67
74
return CPROVER_EXIT_INCORRECT_TASK;
68
75
}
69
76
0 commit comments