Bug 561

Summary: CommandLine based programs should exit with non-zero return if bad parameters are given
Product: ns-3 Reporter: Gustavo J. A. M. Carneiro <gjcarneiro>
Component: coreAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: mathieu.lacage
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   

Description Gustavo J. A. M. Carneiro 2009-05-04 11:20:53 UTC
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 Mathieu Lacage 2009-05-04 11:25:31 UTC
the problem is that this will return -1 even if the user calls --PrintHelp
Comment 2 Gustavo J. A. M. Carneiro 2009-05-04 11:28:11 UTC
(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 Mathieu Lacage 2009-05-04 11:29:30 UTC
what I meant is that --PrintHelp is not a bad parameter.
Comment 4 Mathieu Lacage 2009-06-03 04:03:00 UTC
changeset 6aa43c812fec