HDFGroup / hdf5-json

Specification and tools for representing HDF5 in JSON
https://hdf5-json.readthedocs.io
Other
72 stars 25 forks source link

h5tojson.py should exit with a non-zero error code when the file does not exist #35

Closed mkobit closed 8 years ago

mkobit commented 8 years ago

I am using this hytojson.py as a command line script. When I attempt to run it with a file that is missing, it returns a 0 error code with the output `

hdf5-json/util# python h5tojson.py hello
Cannot find file: hello
hdf5-json/util# echo $?
0

This does not follow the same sort of pattern that other command line utilities follow.

hdf5-json/util# echo $?
2
hdf5-json/util# cat notafile
cat: notafile: No such file or directory
hdf5-json/util# echo $?
1

I think that if the script can not find the file, it should not return a 0 status code. Thoughts?

jreadey commented 8 years ago

Makes sense - I'll update the scripts to return 1 on failure.

jreadey commented 8 years ago

Ok - this was a small update. Fixed in commit: 75222e41b03a1deddab7d1fd7a4b1d85c89cb08e.

mkobit commented 8 years ago

Awesome. Thanks for the change!