diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2006-10-19 19:48:42 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2006-10-19 19:48:42 (GMT) |
commit | e925ba26bb5507b81a0cf1a3cd784572e6efff85 (patch) | |
tree | 2175703ee163150306b8b5aff0990e04912df678 /tools | |
parent | 06a2780901e2f14b0bfad7b89aeb6eb3f9b95735 (diff) | |
download | hdf5-e925ba26bb5507b81a0cf1a3cd784572e6efff85.zip hdf5-e925ba26bb5507b81a0cf1a3cd784572e6efff85.tar.gz hdf5-e925ba26bb5507b81a0cf1a3cd784572e6efff85.tar.bz2 |
[svn-r12786]
a more improved usage message, specially on the filter and layout
information
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5repack/h5repack_main.c | 174 |
1 files changed, 89 insertions, 85 deletions
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 3365b69..1d2ec98 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -20,7 +20,95 @@ /* module-scoped variables */ const char *progname = "h5repack"; int d_status = EXIT_SUCCESS; -static void usage(void); + + +/*------------------------------------------------------------------------- + * Function: usage + * + * Purpose: print usage + * + * Return: void + * + *------------------------------------------------------------------------- + */ + +static +void usage(void) +{ + printf("usage: h5repack -i input -o output [-h] [-v] [-f FILTER] [-l LAYOUT] [-n] [-m size] [-e file]\n"); + printf("\n"); + printf("-i input Input HDF5 File\n"); + printf("-o output Output HDF5 File\n"); + printf("[-h] Print this message\n"); + printf("[-v] Verbose mode\n"); + printf("[-n] Use a native HDF5 type when repacking. Default is the file type\n"); + printf("[-m size] Do not apply the filter to objects smaller than size\n"); + printf("[-e file] Name of file with the -f and -l options\n"); + printf("[-f FILTER] Filter type\n"); + printf("[-l LAYOUT] Layout type\n"); + printf("\n"); + printf("FILTER is a string with the format:\n"); + printf("\n"); + printf(" <list of objects>:<name of filter>=<filter parameters>\n"); + printf("\n"); + printf(" <list of objects> is a comma separated list of object names, meaning apply\n"); + printf(" compression only to those objects. If no names are specified, the filter\n"); + printf(" is applied to all objects\n"); + printf(" <name of filter> can be:\n"); + printf(" GZIP, to apply the HDF5 GZIP filter (GZIP compression)\n"); + printf(" SZIP, to apply the HDF5 SZIP filter (SZIP compression)\n"); + printf(" SHUF, to apply the HDF5 shuffle filter\n"); + printf(" FLET, to apply the HDF5 checksum filter\n"); + printf(" NBIT, to apply the HDF5 NBIT filter (NBIT compression)\n"); + printf(" SOFF, to apply the HDF5 Scale/Offset filter\n"); + printf(" NONE, to remove all filters\n"); + printf(" <filter parameters> is optional filter parameter information\n"); + printf(" GZIP=<deflation level> from 1-9\n"); + printf(" SZIP=<pixels per block,coding> pixels per block is a even number in\n"); + printf(" 2-32 and coding method is either EC or NN\n"); + printf(" SHUF (no parameter)\n"); + printf(" FLET (no parameter)\n"); + printf(" NBIT (no parameter)\n"); + printf(" SOFF=<scale_factor,scale_type> scale_factor is an integer and scale_type\n"); + printf(" is either IN or DS\n"); + printf(" NONE (no parameter)\n"); + printf("\n"); + printf("LAYOUT is a string with the format:\n"); + printf("\n"); + printf(" <list of objects>:<layout type>=<layout parameters>\n"); + printf("\n"); + printf(" <list of objects> is a comma separated list of object names, meaning that\n"); + printf(" layout information is supplied for those objects. If no names are\n"); + printf(" specified, the layout type is applied to all objects\n"); + printf(" <layout type> can be:\n"); + printf(" CHUNK, to apply chunking layout\n"); + printf(" COMPA, to apply compact layout\n"); + printf(" CONTI, to apply continuous layout\n"); + printf(" <layout parameters> is optional layout information\n"); + printf(" CHUNK=DIM[xDIM...xDIM], the chunk size of each dimension\n"); + printf(" COMPA (no parameter)\n"); + printf(" CONTI (no parameter)\n"); + printf("\n"); + printf("Examples of use:\n"); + printf("\n"); + printf("1) h5repack -v -i file1 -o file2 -f GZIP=1\n"); + printf("\n"); + printf(" GZIP compression with level 1 to all objects\n"); + printf("\n"); + printf("2) h5repack -v -i file1 -o file2 -f A:SZIP=8,NN\n"); + printf("\n"); + printf(" SZIP compression with 8 pixels per block and NN coding method to object A\n"); + printf("\n"); + printf("3) h5repack -v -i file1 -o file2 -l A,B:CHUNK=20x10 -f C,D,F:NONE\n"); + printf("\n"); + printf(" Chunked layout, with a layout size of 20x10, to objects A and B\n"); + printf(" and remove filters to objects C, D, F\n"); + printf("\n"); +} + + + + /*------------------------------------------------------------------------- * Function: main @@ -142,87 +230,3 @@ int main(int argc, char **argv) return 0; } -/*------------------------------------------------------------------------- - * Function: usage - * - * Purpose: print usage - * - * Return: void - * - *------------------------------------------------------------------------- - */ - -static -void usage(void) -{ - printf("usage: h5repack -i input -o output [-h] [-v] [-f FILTER] [-l LAYOUT] [-n] [-m size] [-e file]\n"); - printf("\n"); - printf("-i input Input HDF5 File\n"); - printf("-o output Output HDF5 File\n"); - printf("[-h] Print this message\n"); - printf("[-v] Verbose mode\n"); - printf("[-n] Use a native HDF5 type when repacking. Default is the file type\n"); - printf("[-m size] Do not apply the filter to objects smaller than size\n"); - printf("[-e file] Name of file with the -f and -l options\n"); - printf("[-f FILTER] Filter type\n"); - printf("[-l LAYOUT] Layout type\n"); - printf("\n"); - printf("FILTER is a string with the format:\n"); - printf("\n"); - printf(" <list of objects> : <name of filter> = <filter parameters>\n"); - printf("\n"); - printf(" <list of objects> is a comma separated list of object names\n"); - printf(" meaning apply compression only to those objects.\n"); - printf(" if no object names are specified, the filter is applied to all objects\n"); - printf(" <name of filter> can be:\n"); - printf(" GZIP, to apply the HDF5 GZIP filter (GZIP compression)\n"); - printf(" SZIP, to apply the HDF5 SZIP filter (SZIP compression)\n"); - printf(" SHUF, to apply the HDF5 shuffle filter\n"); - printf(" FLET, to apply the HDF5 checksum filter\n"); - printf(" NBIT, to apply the HDF5 NBIT filter (NBIT compression)\n"); - printf(" SOFF, to apply the HDF5 Scale/Offset filter\n"); - printf(" NONE, to remove the filter\n"); - printf(" <filter parameters> is optional compression info\n"); - printf(" SHUF (no parameter)\n"); - printf(" FLET (no parameter)\n"); - printf(" NBIT (no parameter)\n"); - printf(" GZIP=<deflation level> from 1-9\n"); - printf(" SZIP=<pixels per block,coding>\n"); - printf(" (pixels per block is a even number in 2-32 and coding method\n"); - printf(" is 'EC' or 'NN')\n"); - printf(" SOFF=<scale_factor,scale_type>\n"); - printf(" (scale_factor is an integer and scale_type is either 'IN'\n"); - printf(" for integer type, or 'DS', for floating point type\n"); - printf(" using the D-scaling method)\n"); - printf("\n"); - printf("LAYOUT is a string with the format:\n"); - printf("\n"); - printf(" <list of objects> : <layout type>\n"); - printf("\n"); - printf(" <list of objects> is a comma separated list of object names,\n"); - printf(" meaning that layout information is supplied for those objects.\n"); - printf(" if no object names are specified, the layout is applied to all objects\n"); - printf(" <layout type> can be:\n"); - printf(" CHUNK, to apply chunking layout\n"); - printf(" COMPA, to apply compact layout\n"); - printf(" CONTI, to apply continuous layout\n"); - printf(" <layout parameters> is present for the chunk case only\n"); - printf(" it is the chunk size of each dimension:\n"); - printf(" <dim_1 x dim_2 x ... dim_n>\n"); - printf("\n"); - printf("Examples of use:\n"); - printf("\n"); - printf("1) h5repack -i file1 -o file2 -f GZIP=1 -v\n"); - printf("\n"); - printf(" Applies GZIP compression to all objects in file1 and saves the output in file2\n"); - printf("\n"); - printf("2) h5repack -i file1 -o file2 -f dset1:SZIP=8,NN -v\n"); - printf("\n"); - printf(" Applies SZIP compression only to object 'dset1'\n"); - printf("\n"); - printf("3) h5repack -i file1 -o file2 -l dset1,dset2:CHUNK=20x10 -v\n"); - printf("\n"); - printf(" Applies chunked layout to objects 'dset1' and 'dset2'\n"); - printf("\n"); -} - |