#! /usr/bin/env python

import sys

from larpe import ctl

def print_usage():
    print 'Usage: larpectl.py command [...]'
    print ''
    print 'Commands:'
    print '  start                start server'
    print '  cache_modulesets     parse and cache jhbuild module sets'


if len(sys.argv) < 2:
    print_usage()
    sys.exit(1)
else:
    command = sys.argv[1]

    if command == 'start':
        ctl.start(sys.argv[2:])
    elif command == 'cache_modulesets':
        ctl.cache_modulesets()
    else:
        print_usage()
