[svn-r14236] new feature: add a -V option to h5unjam

tested: linux
This commit is contained in:
Pedro Vicente Nunes 2007-11-05 14:05:10 -05:00
parent 467f103cb1
commit c57f03ad75

View File

@ -45,7 +45,7 @@ char *ub_file = NULL;
* parameters. The long-named ones can be partially spelled. When * parameters. The long-named ones can be partially spelled. When
* adding more, make sure that they don't clash with each other. * adding more, make sure that they don't clash with each other.
*/ */
static const char *s_opts = "hu:i:o:d"; static const char *s_opts = "hu:i:o:d:V";
static struct long_options l_opts[] = { static struct long_options l_opts[] = {
{ "help", no_arg, 'h' }, { "help", no_arg, 'h' },
{ "hel", no_arg, 'h' }, { "hel", no_arg, 'h' },
@ -83,6 +83,8 @@ usage(const char *prog)
fprintf(stdout, " %s -h\n",prog); fprintf(stdout, " %s -h\n",prog);
fprintf(stdout, " Print a usage message and exit\n"); fprintf(stdout, " Print a usage message and exit\n");
fprintf(stdout, " %s -V \n", prog);
fprintf(stdout, " Print HDF5 library version and exit\n");
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
@ -121,13 +123,16 @@ parse_command_line(int argc, const char *argv[])
case 'd': case 'd':
do_delete = TRUE; do_delete = TRUE;
break; break;
case 'h': case 'h':
usage(progname); usage(progname);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
case '?': case 'V':
default: print_version (progname);
usage(progname); exit (EXIT_SUCCESS);
exit(EXIT_FAILURE); case '?':
default:
usage(progname);
exit(EXIT_FAILURE);
} }
} }