diff options
Diffstat (limited to 'tools/src/h5repack/h5repack_main.c')
-rw-r--r-- | tools/src/h5repack/h5repack_main.c | 59 |
1 files changed, 38 insertions, 21 deletions
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index 7e1ad96..1f1b821 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -31,35 +31,37 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char * s_opts = "hVvf:l:m:e:nLj:k:c:d:s:u:b:M:t:a:i:o:S:P:T:G:q:z:E"; -static struct long_options l_opts[] = {{"help", no_arg, 'h'}, - {"version", no_arg, 'V'}, - {"verbose", no_arg, 'v'}, +static const char * s_opts = "a:b:c:d:e:f:hi:j:k:l:m:no:q:s:t:u:vz:EG:LM:P:S:T:VXW1:2:3:4:5:6:"; +static struct long_options l_opts[] = {{"alignment", require_arg, 'a'}, + {"block", require_arg, 'b'}, + {"compact", require_arg, 'c'}, + {"indexed", require_arg, 'd'}, + {"file", require_arg, 'e'}, {"filter", require_arg, 'f'}, + {"help", no_arg, 'h'}, + {"infile", require_arg, 'i'}, /* for backward compability */ + {"low", require_arg, 'j'}, + {"high", require_arg, 'k'}, {"layout", require_arg, 'l'}, {"minimum", require_arg, 'm'}, - {"file", require_arg, 'e'}, {"native", no_arg, 'n'}, - {"latest", no_arg, 'L'}, - {"low", require_arg, 'j'}, - {"high", require_arg, 'k'}, - {"compact", require_arg, 'c'}, - {"indexed", require_arg, 'd'}, + {"outfile", require_arg, 'o'}, /* for backward compability */ + {"sort_by", require_arg, 'q'}, {"ssize", require_arg, 's'}, + {"threshold", require_arg, 't'}, {"ublock", require_arg, 'u'}, - {"block", require_arg, 'b'}, + {"verbose", no_arg, 'v'}, + {"sort_order", require_arg, 'z'}, + {"enable-error-stack", no_arg, 'E'}, + {"fs_pagesize", require_arg, 'G'}, + {"latest", no_arg, 'L'}, {"metadata_block_size", require_arg, 'M'}, - {"threshold", require_arg, 't'}, - {"alignment", require_arg, 'a'}, - {"infile", require_arg, 'i'}, /* for backward compability */ - {"outfile", require_arg, 'o'}, /* for backward compability */ - {"fs_strategy", require_arg, 'S'}, {"fs_persist", require_arg, 'P'}, + {"fs_strategy", require_arg, 'S'}, {"fs_threshold", require_arg, 'T'}, - {"fs_pagesize", require_arg, 'G'}, - {"sort_by", require_arg, 'q'}, - {"sort_order", require_arg, 'z'}, - {"enable-error-stack", no_arg, 'E'}, + {"version", no_arg, 'V'}, + {"merge", no_arg, 'X'}, + {"prune", no_arg, 'W'}, {"src-vol-value", require_arg, '1'}, {"src-vol-name", require_arg, '2'}, {"src-vol-info", require_arg, '3'}, @@ -122,6 +124,12 @@ usage(const char *prog) " --high=BOUND The high bound for library release versions to use\n"); PRINTVALSTREAM(rawoutstream, " when creating objects in the file\n"); PRINTVALSTREAM(rawoutstream, " (default is H5F_LIBVER_LATEST)\n"); + PRINTVALSTREAM(rawoutstream, + " --merge Follow external soft link recursively and merge data\n"); + PRINTVALSTREAM(rawoutstream, + " --prune Do not follow external soft links and remove link\n"); + PRINTVALSTREAM(rawoutstream, + " --merge --prune Follow external link, merge data and remove dangling link\n"); PRINTVALSTREAM(rawoutstream, " -c L1, --compact=L1 Maximum number of links in header messages\n"); PRINTVALSTREAM(rawoutstream, " -d L2, --indexed=L2 Minimum number of links in the indexed format\n"); @@ -254,6 +262,7 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, " Required values: filter_number, filter_flag, cd_value_count, value1\n"); PRINTVALSTREAM(rawoutstream, " Optional values: value2 to valueN\n"); + PRINTVALSTREAM(rawoutstream, " filter_flag: 1 is OPTIONAL or 0 is MANDATORY\n"); PRINTVALSTREAM(rawoutstream, " NONE (no parameter)\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " LAYT - is a string with the format:\n"); @@ -358,7 +367,7 @@ read_info(const char *filename, pack_opt_t *options) break; /* Info indicator must be for layout or filter */ - if (HDstrcmp(stype, "-l") && HDstrcmp(stype, "-f")) { + if (HDstrcmp(stype, "-l") != 0 && HDstrcmp(stype, "-f") != 0) { error_msg("bad file format for %s", filename); h5tools_setstatus(EXIT_FAILURE); ret_value = EXIT_FAILURE; @@ -588,6 +597,14 @@ parse_command_line(int argc, const char **argv, pack_opt_t *options) options->high_bound = bound; break; + case 'X': + options->merge = TRUE; + break; + + case 'W': + options->prune = TRUE; + break; + case 'c': options->grp_compact = HDatoi(opt_arg); if (options->grp_compact > 0) |