[svn-r16300] Added an option to avoid dealing with NaNs

-N, --nan               Avoid NaNs detection
Note: there is no shell script run for datasets with NaN because the output is non portable (different results and NaN strings for different systems)

Tested: windows, linux
This commit is contained in:
Pedro Vicente Nunes
2009-01-13 11:33:31 -05:00
parent 050ded21d3
commit 108699a7a8
17 changed files with 136 additions and 96 deletions

View File

@@ -31,7 +31,7 @@ const char *progname = "h5diff";
* Command-line options: The user can specify short or long-named
* parameters.
*/
static const char *s_opts = "hVrvqn:d:p:";
static const char *s_opts = "hVrvqn:d:p:N";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "version", no_arg, 'V' },
@@ -41,6 +41,7 @@ static struct long_options l_opts[] = {
{ "count", require_arg, 'n' },
{ "delta", require_arg, 'd' },
{ "relative", require_arg, 'p' },
{ "nan", no_arg, 'N' },
{ NULL, 0, '\0' }
};
@@ -70,6 +71,9 @@ void parse_command_line(int argc,
/* assume equal contents initially */
options->contents = 1;
/* NaNs are handled by default */
options->do_nans = 1;
/* parse command line options */
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF)
{
@@ -130,6 +134,10 @@ void parse_command_line(int argc,
options->count = atol( opt_arg );
break;
case 'N':
options->do_nans = 0;
break;
}
}
@@ -323,6 +331,7 @@ void usage(void)
printf(" -r, --report Report mode. Print differences\n");
printf(" -v, --verbose Verbose mode. Print differences, list of objects\n");
printf(" -q, --quiet Quiet mode. Do not do output\n");
printf(" -N, --nan Avoid NaNs detection\n");
printf(" -n C, --count=C Print differences up to C number\n");
printf(" -d D, --delta=D Print difference when greater than limit D\n");