]> scripts.mit.edu Git - wizard.git/blob - wizard/command/errors.py
Move a bunch of summary items to full class commands.
[wizard.git] / wizard / command / errors.py
1 import logging
2
3 from wizard import deploy, command
4
5 def main(argv, baton):
6     options, show = parse_args(argv, baton)
7     for e in deploy.parse_install_lines(show, options, True):
8         if not isinstance(e, deploy.Error):
9             if isinstance(e, Exception):
10                 raise e
11             continue
12         if options.verbose:
13             print e
14         else:
15             print e.location
16
17 def parse_args(argv, baton):
18     usage = """usage: %prog errors [ARGS]
19
20 Lists all errors that occurred while parsing the versions
21 directory."""
22     parser = command.WizardOptionParser(usage)
23     baton.push(parser, "versions_path")
24     options, args = parser.parse_all(argv)
25     if len(args) > 1:
26         parser.error("too many arguments")
27     return options, args
28