summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_main.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2006-10-05 14:35:40 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2006-10-05 14:35:40 (GMT)
commit5df5ee8956c9613793908169676de0fb47582c71 (patch)
treea48346c4a0d1e6284ad916807030e288a6979577 /tools/h5repack/h5repack_main.c
parent4d8a0f4c54b95c5b865ebdee6e82cf42c7b44c5a (diff)
downloadhdf5-5df5ee8956c9613793908169676de0fb47582c71.zip
hdf5-5df5ee8956c9613793908169676de0fb47582c71.tar.gz
hdf5-5df5ee8956c9613793908169676de0fb47582c71.tar.bz2
[svn-r12720]
added output of error messages using the tools library function error_msg, that prints the program name and error on the message tested: kagiso
Diffstat (limited to 'tools/h5repack/h5repack_main.c')
-rw-r--r--tools/h5repack/h5repack_main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index 333a49a..92433f9 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -14,8 +14,10 @@
#include <stdlib.h>
#include <string.h>
+#include "h5tools_utils.h"
#include "h5repack.h"
+/* module-scoped variables */
const char *progname = "h5repack";
int d_status = EXIT_SUCCESS;
static void usage(void);
@@ -69,7 +71,10 @@ int main(int argc, char **argv)
/* add the -f filter option */
if (h5repack_addfilter(argv[i+1],&options)<0)
+ {
+ error_msg(progname, "in parsing filter\n");
exit(1);
+ }
/* jump to next */
++i;
@@ -78,7 +83,10 @@ int main(int argc, char **argv)
/* parse the -l layout option */
if (h5repack_addlayout(argv[i+1],&options)<0)
+ {
+ error_msg(progname, "in parsing layout\n");
exit(1);
+ }
/* jump to next */
++i;
@@ -87,7 +95,7 @@ int main(int argc, char **argv)
else if (strcmp(argv[i], "-m") == 0) {
options.threshold = parse_number(argv[i+1]);
if ((int)options.threshold==-1) {
- printf("Error: Invalid treshold size <%s>\n",argv[i+1]);
+ error_msg(progname, "invalid treshold size <%s>\n",argv[i+1]);
exit(1);
}
++i;
@@ -98,6 +106,7 @@ int main(int argc, char **argv)
}
else if (argv[i][0] == '-') {
+ error_msg(progname, " - is not a valid argument\n");
usage();
exit(1);
}
@@ -105,6 +114,7 @@ int main(int argc, char **argv)
if (infile == NULL || outfile == NULL)
{
+ error_msg(progname, "file names missing\n");
usage();
exit(1);
}