-import logging
import os
-import optparse
-import sys
-import distutils.version
-from wizard import command, deploy, git, shell, util
+from wizard import command, shell, util
def main(argv, baton):
options, args = parse_args(argv, baton)
- if not args:
- reason = ""
- else:
- reason = args[0]
- sh = shell.Shell()
+ reason = args[0]
+ # XXX: this should be abstracted away!
if os.path.exists(".git/WIZARD_REPO"):
- util.chdir(sh.eval('git', 'config', 'remote.origin.url'))
+ util.chdir(shell.eval('git', 'config', 'remote.origin.url'))
open('.scripts/blacklisted', 'w').write(reason + "\n")
def parse_args(argv, baton):
- usage = """usage: %prog blacklist [ARGS] [REASON]
+ usage = """usage: %prog blacklist [ARGS] REASON
Touches .scripts/blacklisted so that we don't attempt
to upgrade the script in the future."""
parser = command.WizardOptionParser(usage)
options, args = parser.parse_all(argv)
- if len(args) > 1:
+ if len(args) > 2:
parser.error("too many arguments")
+ if len(args) < 1:
+ parser.error("must specify reason")
return options, args