X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/blobdiff_plain/6e279f5f59b83c0494a4be9bb90a7f0e325faa0c..981d8b73e14d907ddbd9c5c17818051fcdf1bd50:/wizard/command/database.py diff --git a/wizard/command/database.py b/wizard/command/database.py new file mode 100644 index 0000000..ee59321 --- /dev/null +++ b/wizard/command/database.py @@ -0,0 +1,20 @@ +from wizard import deploy, command + +def main(argv, baton): + options, args = parse_args(argv, baton) + dir = args[0] + deployment = deploy.ProductionCopy(dir) + print deployment.dsn.database + +def parse_args(argv, baton): + usage = """usage: %prog database DIR + +Prints the name of the database an application is using. +Maybe in the future this will print more information.""" + parser = command.WizardOptionParser(usage) + options, args = parser.parse_all(argv) + if len(args) > 1: + parser.error("too many arguments") + if len(args) == 0: + parser.error("must specify directory") + return options, args