diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-10-15 19:30:02 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-10-15 19:30:02 (GMT) |
commit | b779addfb962eba330f88abbf478c62547fe952f (patch) | |
tree | f0b62ec9fa784a34084d48676c8a2564bc7d1852 /tools/h5diff | |
parent | 2241e1529ebe0f31a201bf5c1a799a8eb20ee37d (diff) | |
download | hdf5-b779addfb962eba330f88abbf478c62547fe952f.zip hdf5-b779addfb962eba330f88abbf478c62547fe952f.tar.gz hdf5-b779addfb962eba330f88abbf478c62547fe952f.tar.bz2 |
[svn-r15874] Eliminate -c option and make that behavior the default and return 2 instead of -1 on error status
Tested: windows, linux
Diffstat (limited to 'tools/h5diff')
-rw-r--r-- | tools/h5diff/h5diff_main.c | 31 | ||||
-rwxr-xr-x | tools/h5diff/testh5diff.sh | 3 |
2 files changed, 9 insertions, 25 deletions
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 286ca2ba..058f160 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -16,6 +16,8 @@ #include "h5diff.h" #include "h5tools_utils.h" #include <stdlib.h> +#include <memory.h> +#include <string.h> void usage(void); void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options); @@ -33,7 +35,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' }, @@ -43,7 +45,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' } }; @@ -87,13 +88,6 @@ static struct long_options l_opts[] = { * February 20, 2008 * adopted the syntax h5diff [OPTIONS] file1 file2 [obj1[obj2]] * - * Aug 2008 - * Added a "contents" mode - * If this mode is present, objects in both files must match (must be exactly the same) - * If this does not happen, the tool returns an error code of 1 - * (instead of the success code of 0) - * - * *------------------------------------------------------------------------- */ @@ -121,11 +115,11 @@ int main(int argc, const char *argv[]) ret = (nfound == 0 ? 0 : 1 ); - if ( options.m_contents && options.contents == 0 ) + if ( options.contents == 0 ) ret = 1; if(options.err_stat) - ret = -1; + ret = 2; return ret; } @@ -175,9 +169,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; @@ -259,7 +250,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) @@ -408,8 +399,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"); printf(" -d D, --delta=D Print difference when greater than limit D\n"); @@ -430,16 +419,14 @@ 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"); @@ -451,7 +438,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"); diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index 890a33a..db1e208 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -303,9 +303,6 @@ TOOLTEST h5diff_17.txt -v $FILE1 $FILE2 # 1.8 quiet mode TOOLTEST h5diff_18.txt -q $FILE1 $FILE2 -# 1.9 contents mode -TOOLTEST h5diff_19.txt -v -c $FILE1 $FILE11 - # ############################################################################## # # not comparable types |