~unity-2d-team/unity-2d/Shell-MultiMonitor

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python

from optparse import OptionParser

from grackle.server.model import create_schema


parser = OptionParser(usage="usage: %prog [options] <hostname> <keyspace>")
parser.add_option(
    "--clobber", action="store_true", default=False, dest="clobber",
    help="clear the keyspace before initialising it")
parser.add_option(
    "--create-keyspace", action="store_true", default=False,
    dest="create_keyspace",
    help="create the keyspace (with SimpleStrategy, RF=1)")
options, args = parser.parse_args()

if len(args) != 2:
    parser.error("hostname and keyspace required")

create_schema(
    args[0], args[1], clobber=options.clobber,
    create_keyspace=options.create_keyspace)