]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/errors.py
Move a bunch of summary items to full class commands.
[wizard.git] / wizard / command / errors.py
diff --git a/wizard/command/errors.py b/wizard/command/errors.py
new file mode 100644 (file)
index 0000000..5250254
--- /dev/null
@@ -0,0 +1,28 @@
+import logging
+
+from wizard import deploy, command
+
+def main(argv, baton):
+    options, show = parse_args(argv, baton)
+    for e in deploy.parse_install_lines(show, options, True):
+        if not isinstance(e, deploy.Error):
+            if isinstance(e, Exception):
+                raise e
+            continue
+        if options.verbose:
+            print e
+        else:
+            print e.location
+
+def parse_args(argv, baton):
+    usage = """usage: %prog errors [ARGS]
+
+Lists all errors that occurred while parsing the versions
+directory."""
+    parser = command.WizardOptionParser(usage)
+    baton.push(parser, "versions_path")
+    options, args = parser.parse_all(argv)
+    if len(args) > 1:
+        parser.error("too many arguments")
+    return options, args
+