diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-05-24 12:49:24 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-05-24 12:49:24 (GMT) |
commit | 65de8add1f47b0a8a0f1e5932ce0684fc2d529fd (patch) | |
tree | f562245eba0f7736ae89a1f5128672f8b63a3069 | |
parent | b08afe35a41fc89bfa2d4ad7d412b4c91a25dacf (diff) | |
download | hdf5-65de8add1f47b0a8a0f1e5932ce0684fc2d529fd.zip hdf5-65de8add1f47b0a8a0f1e5932ce0684fc2d529fd.tar.gz hdf5-65de8add1f47b0a8a0f1e5932ce0684fc2d529fd.tar.bz2 |
[svn-r13805]
Early detection of no arguments, print usage and exit
Tested: linux
-rw-r--r-- | tools/h5diff/h5diff_common.c | 1 | ||||
-rw-r--r-- | tools/h5dump/h5dump.c | 6 | ||||
-rw-r--r-- | tools/testfiles/h5diff_600.txt | 1 | ||||
-rw-r--r-- | tools/testfiles/tnofilename.ddl | 1 |
4 files changed, 6 insertions, 3 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index bf0b63a..bee2c86 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -50,7 +50,6 @@ void parse_input(int argc, if ( argc<3 ) { - printf("Number of arguments is only %d\n", argc ); usage(); } diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 8322cbc..069a522 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -3377,6 +3377,12 @@ parse_command_line(int argc, const char *argv[]) const char *outfname=NULL; bin_form = -1; + /* no arguments */ + if (argc == 1) { + usage(progname); + leave(EXIT_FAILURE); + } + /* this will be plenty big enough to hold the info */ hand = calloc((size_t)argc, sizeof(struct handler_t)); diff --git a/tools/testfiles/h5diff_600.txt b/tools/testfiles/h5diff_600.txt index e925cb7..aaa60f9 100644 --- a/tools/testfiles/h5diff_600.txt +++ b/tools/testfiles/h5diff_600.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff h5diff_basic1.h5' ############################# -Number of arguments is only 2 usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] file1 File name of the first HDF5 file diff --git a/tools/testfiles/tnofilename.ddl b/tools/testfiles/tnofilename.ddl index 054a829..a516dde 100644 --- a/tools/testfiles/tnofilename.ddl +++ b/tools/testfiles/tnofilename.ddl @@ -73,4 +73,3 @@ usage: h5dump [OPTIONS] file h5dump -d /dset -b LE -o out.bin quux.h5 -h5dump error: missing file name |