]> scripts.mit.edu Git - wizard.git/blob - wizard/command/summary/list.py
Add creation of .scripts/version for easy parallel-find.
[wizard.git] / wizard / command / summary / list.py
1 import logging
2 import traceback
3
4 from wizard import command
5 from wizard.command import summary
6
7 def main(argv, baton):
8     options, show = parse_args(argv, baton)
9     errors = 0
10     for d in summary.parse_install_lines(show, options, True):
11         if isinstance(d, Exception):
12             errors += 1
13         print d.location
14     if errors:
15         logging.warning("%d errors, see wizard summary list-errors for details" % errors)
16
17 def parse_args(argv, baton):
18     usage = """usage: %prog summary list [ARGS] [APP[-VERSION]]
19
20 Lists the locations of all autoinstalls, optionally
21 filtered on application name and version.
22
23 Examples:
24     %prog summary list
25         List all autoinstalls
26     %prog summary list mediawiki
27         List only MediaWiki autoinstalls
28     %prog summary list mediawiki-1.11.0
29         List only Mediawiki 1.11.0 autoinstalls"""
30     parser = command.WizardOptionParser(usage)
31     baton.push(parser, "versions_path")
32     options, args = parser.parse_all(argv)
33     if len(args) > 1:
34         parser.error("too many arguments")
35     return options, args
36