Bug 561 - CommandLine based programs should exit with non-zero return if bad parameters are given
: CommandLine based programs should exit with non-zero return if bad parameters...
Status: RESOLVED FIXED
: ns-3
simulation core
: ns-3-dev
: All All
: P5 minor
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-05-04 11:20 EDT by
Modified: 2009-06-03 04:03 EDT (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-05-04 11:20:53 EDT
When a ns-3 program is run with bad command-line parameters, it is exiting with
zero exit code, which is obviously wrong.  Minor but annoying problem; easy
fix:

void
CommandLine::PrintHelp (void) const
{
[...]
-  exit (0);
-  exit (1);
}
------- Comment #1 From 2009-05-04 11:25:31 EDT -------
the problem is that this will return -1 even if the user calls --PrintHelp
------- Comment #2 From 2009-05-04 11:28:11 EDT -------
(In reply to comment #1)
> the problem is that this will return -1 even if the user calls --PrintHelp

OK, I need to describe the problem better.  Re-titling.
------- Comment #3 From 2009-05-04 11:29:30 EDT -------
what I meant is that --PrintHelp is not a bad parameter.
------- Comment #4 From 2009-06-03 04:03:00 EDT -------
changeset 6aa43c812fec