mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
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:
parent
ef75ea068c
commit
e6df8cbe24
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user