5 from wizard import command, deploy, git
9 usage = """usage: %prog configure [ARGS]
11 Takes an already cloned working copy and configures the
12 application. Options change depending on the current
15 WARNING: This command's API may change."""
17 # XXX: squick squick squick
18 if argv and argv[0][0] != '-':
19 if '--help' not in argv and '-h' not in argv:
21 if '--help' in argv or '-h' in argv:
22 # Do a "fake parse" in order to get out the application name
23 parser = optparse.OptionParser(usage, add_help_option=False)
24 parser.add_option("--help", "-h", action="store_true")
25 options, args = parser.parse_args(argv)
29 parser.error("Use 'wizard configure --help APP' to see APP-specific options.")
32 application, _, version = tag.partition('-')
34 app = deploy.applications()[application]
35 handler = app.install_handler
37 parser = command.WizardOptionParser(usage)
39 options, args = parser.parse_all(argv)
40 handler.handle(options)