Add allowed choices to output format.

Since we're using the print function, we can specify the file handler to
user and in this case we choose `sys.stderr`
This commit is contained in:
Pedro Algarvio 2015-07-12 12:27:26 +01:00
parent ef75ea068c
commit e6df8cbe24

View File

@ -36,6 +36,7 @@ def parse():
'-f',
'--format',
dest='format',
choices=('pprint', 'yaml'),
default='pprint')
out = parser.parse_args()
return out.__dict__
@ -49,7 +50,7 @@ def mod_data(opts, full):
try:
finder.load_file(full)
except ImportError:
sys.stderr.write('ImportError - {0}\n'.format(full))
print('ImportError - {0}'.format(full), file=sys.stderr)
return ret
for name, mod in finder.modules.items():
basemod = name.split('.')[0]