mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-19 16:50:46 +08:00
[svn-r13805]
Early detection of no arguments, print usage and exit Tested: linux
This commit is contained in:
parent
b08afe35a4
commit
65de8add1f
@ -50,7 +50,6 @@ void parse_input(int argc,
|
||||
|
||||
if ( argc<3 )
|
||||
{
|
||||
printf("Number of arguments is only %d\n", argc );
|
||||
usage();
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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
|
||||
|
@ -73,4 +73,3 @@ usage: h5dump [OPTIONS] file
|
||||
|
||||
h5dump -d /dset -b LE -o out.bin quux.h5
|
||||
|
||||
h5dump error: missing file name
|
||||
|
Loading…
x
Reference in New Issue
Block a user