Skip to content
Snippets Groups Projects
Commit 2d925fbd authored by Eva Schiffer's avatar Eva Schiffer Committed by GitHub
Browse files

Merge pull request #7 from adesmet-ssec/info-exit-code

if glance info can't read files, return non-zero
parents fd3b2f9e 4758bcca
No related branches found
Tags 0.15.1
No related merge requests found
......@@ -1184,6 +1184,7 @@ glance inspectStats A.hdf
"""list information about a list of files
List available variables for comparison.
"""
problems = 0
for fn in args:
try :
lal = list(io.open(fn)())
......@@ -1191,6 +1192,11 @@ glance inspectStats A.hdf
print fn + ': ' + ('\n ' + ' '*len(fn)).join(lal)
except KeyError :
LOG.warn('Unable to open / process file selection: ' + fn)
problems += 1
if problems > 255:
# exit code is 8-bits, limit ourselves.
problems = 255
return problems
def stats(*args):
"""create statistics summary of variables
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment