]> scripts.mit.edu Git - wizard.git/blob - wizard/command/database.py
tests/all-versions.sh runs all tests for all versions of the specified app.
[wizard.git] / wizard / command / database.py
1 from wizard import deploy, command
2
3 def main(argv, baton):
4     options, args = parse_args(argv, baton)
5     dir = args[0]
6     deployment = deploy.ProductionCopy(dir)
7     print deployment.dsn.database
8
9 def parse_args(argv, baton):
10     usage = """usage: %prog database DIR
11
12 Prints the name of the database an application is using.
13 Maybe in the future this will print more information."""
14     parser = command.WizardOptionParser(usage)
15     options, args = parser.parse_all(argv)
16     if len(args) > 1:
17         parser.error("too many arguments")
18     if len(args) == 0:
19         parser.error("must specify directory")
20     return options, args