[svn-r15987] Merge with 1.8 rev 15871

Eliminate -c option and make that behavior the default and return 2 instead of -1 on error status

tested: linux
This commit is contained in:
Pedro Vicente Nunes
2008-10-29 14:29:25 -05:00
parent cea8049404
commit e636e152ea
21 changed files with 53 additions and 125 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:c";
static const char *s_opts = "hVrvqn:d:p:";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "version", no_arg, 'V' },
@@ -41,7 +41,6 @@ static struct long_options l_opts[] = {
{ "count", require_arg, 'n' },
{ "delta", require_arg, 'd' },
{ "relative", require_arg, 'p' },
{ "contents", no_arg, 'c' },
{ NULL, 0, '\0' }
};
@@ -92,9 +91,6 @@ void parse_command_line(int argc,
case 'r':
options->m_report = 1;
break;
case 'c':
options->m_contents = 1;
break;
case 'd':
options->d=1;
@@ -174,7 +170,7 @@ void parse_command_line(int argc,
void print_info(diff_opt_t* options)
{
if (options->m_quiet || options->err_stat || options->m_contents)
if (options->m_quiet || options->err_stat )
return;
if (options->cmn_objs==0)
@@ -323,7 +319,6 @@ 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(" -c, --contents Contents mode. Objects in both files must match\n");
printf(" -n C, --count=C Print differences up to C number\n");
@@ -345,16 +340,13 @@ void usage(void)
printf(" -r Report mode: print the above plus the differences\n");
printf(" -v Verbose mode: print the above plus a list of objects and warnings\n");
printf(" -q Quiet mode: do not print output\n");
printf(" -c Contents mode: objects in both files must match\n");
printf("\n");
printf(" Compare criteria\n");
printf("\n");
printf(" If no objects [obj1[obj2]] are specified, h5diff only compares objects\n");
printf(" with the same absolute path in both files. However,\n");
printf(" when the -c flag is present, (contents mode) the objects in file1\n");
printf(" must match exactly the objects in file2\n");
printf(" with the same absolute path in both files\n");
printf("\n");
printf(" The compare criteria is:\n");
@@ -366,7 +358,7 @@ void usage(void)
printf(" Return exit code:\n");
printf("\n");
printf(" 1 if differences found, 0 if no differences, -1 if error\n");
printf(" 1 if differences found, 0 if no differences, 2 if error\n");
printf("\n");