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, running any installer scripts and creating
13 configuration files. Options change depending on what
14 application is being configured in the current working directory.
16 This is a plumbing command, normal users should use
19 # XXX: squick squick squick
20 if argv and argv[0][0] != '-':
21 if '--help' not in argv and '-h' not in argv:
23 if '--help' in argv or '-h' in argv:
24 # Do a "fake parse" in order to get out the application name
25 parser = optparse.OptionParser(usage, add_help_option=False)
26 parser.add_option("--help", "-h", action="store_true")
27 options, args = parser.parse_args(argv)
31 parser.error("Use 'wizard configure --help APP' to see APP-specific options.")
34 application, _, version = tag.partition('-')
36 app = deploy.applications()[application]
37 handler = app.install_handler
39 parser = command.WizardOptionParser(usage)
41 options, args = parser.parse_all(argv)
42 handler.handle(options)