~abentley/thekraken/trunk

« back to all changes in this revision

Viewing changes to the-kraken

  • Committer: Aaron Bentley
  • Date: 2010-11-30 05:10:07 UTC
  • Revision ID: aaron@aaronbentley.com-20101130051007-pw82nl5tplioicni
Implement --prepare

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                          usage='usage: %prog [options] VERSION')
37
37
    parser.add_option('--code-name', help='A code-name for the release.',
38
38
                      dest='code_name')
 
39
    parser.add_option('--prepare', help='Prepare for the release',
 
40
                      action="store_true")
39
41
    def do_help(option=None, opt=None, value=None, parser=None, error=False):
40
42
        parser.print_help()
41
43
        sys.stdout.write('\n' + doc)
48
50
        options, args = parser.parse_args()
49
51
        if len(args) == 0:
50
52
            do_help(parser=parser, error=True)
51
 
        version = sys.argv[1]
 
53
        version = args[0]
52
54
        config = TheKrakenData.get_config()
53
55
        with bzrlib.initialize():
54
 
            TheKraken('.', version, config, options.code_name).run()
 
56
            kraken = TheKraken('.', version, config, options.code_name)
 
57
            if options.prepare:
 
58
                kraken.prepare()
 
59
            else:
 
60
                kraken.run()
55
61
    except UserError, e:
56
62
        sys.stderr.write(str(e) + '\n')
57
63
        sys.exit(2)