summaryrefslogtreecommitdiffstats
path: root/tools/h5diff/h5diff_common.c
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-03-22 15:47:07 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-03-22 15:47:07 (GMT)
commit4147de8d02fdfb651e860df999f87263d72be573 (patch)
tree0c12e5c4d19e03085adffaf51ac0fd7f1d67154e /tools/h5diff/h5diff_common.c
parentf92d2371ffce9ec664833187cadb0223fa1dc1c2 (diff)
downloadhdf5-4147de8d02fdfb651e860df999f87263d72be573.zip
hdf5-4147de8d02fdfb651e860df999f87263d72be573.tar.gz
hdf5-4147de8d02fdfb651e860df999f87263d72be573.tar.bz2
[svn-r20294] Purpose:
Fixed CHICAGO: Bug 2121 - h5diff - incorrect and lack of output for the different set of attributes (different number and names) Description: Previously h5diff compared attributes correctly only when two objects have the same number of attributes and attribute names are identical. This fix covers all other cases. Also didn't display useful information about attribute difference. This fixes both issues. Tested: jam (linux32-LE), amani (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE)
Diffstat (limited to 'tools/h5diff/h5diff_common.c')
-rw-r--r--tools/h5diff/h5diff_common.c40
1 files changed, 37 insertions, 3 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index 4870cdb..da45a31 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -27,12 +27,12 @@ static int check_d_input( const char* );
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char *s_opts = "hVrvqn:d:p:Nc";
+static const char *s_opts = "hVrv:qn:d:p:Nc";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "version", no_arg, 'V' },
{ "report", no_arg, 'r' },
- { "verbose", no_arg, 'v' },
+ { "verbose", optional_arg, 'v' },
{ "quiet", no_arg, 'q' },
{ "count", require_arg, 'n' },
{ "delta", require_arg, 'd' },
@@ -63,7 +63,7 @@ void parse_command_line(int argc,
const char** objname2,
diff_opt_t* options)
{
-
+ int i;
int opt;
struct exclude_path_list *exclude_head, *exclude_prev, *exclude_node;
@@ -95,6 +95,40 @@ void parse_command_line(int argc,
h5diff_exit(EXIT_SUCCESS);
case 'v':
options->m_verbose = 1;
+ /* This for loop is for handling style like
+ * -v, -v1, --verbose, --verbose=1.
+ */
+ for (i = 1; i < argc; i++)
+ {
+ /*
+ * short opt
+ */
+ if (!strcmp (argv[i], "-v")) /* no arg */
+ {
+ opt_ind--;
+ options->m_verbose_level = 0;
+ break;
+ }
+ else if (!strncmp (argv[i], "-v", 2))
+ {
+ options->m_verbose_level = atoi(&argv[i][2]);
+ break;
+ }
+
+ /*
+ * long opt
+ */
+ if (!strcmp (argv[i], "--verbose")) /* no arg */
+ {
+ options->m_verbose_level = 0;
+ break;
+ }
+ else if ( !strncmp (argv[i], "--verbose", 9) && argv[i][9]=='=')
+ {
+ options->m_verbose_level = atoi(&argv[i][10]);
+ break;
+ }
+ }
break;
case 'q':
/* use quiet mode; supress the message "0 differences found" */