describe [-c] {tablename}...

def do_describe(self, line):
        "describe [-c] {tablename}..."
        args = self.getargs(line)

        if '-c' in args:
            create_info = True
            args.remove('-c')
        else:
            create_info = False

        if not args:
            if self.table:
                args = [ self.table.table_name ]
            else:
                args = self.tables

        for table in args:
            desc = self.conn.describe_table(table)

            if create_info:
                info = desc['Table']
                name = info['TableName']
                attributes = info['AttributeDefinitions']
                schema = info['KeySchema']

                hkey = ''
                rkey = ''

                for k in schema:
                    aname = k['AttributeName']
                    for a in attributes:
                        if a['AttributeName'] == aname:
                            value = "%s:%s" % (a['AttributeName'], a['AttributeType'])
                            break

                    if k['KeyType'] == 'HASH':
                        hkey = value
                    elif k['KeyType'] == 'RANGE':
                        rkey = ' ' + value

                prov = info['ProvisionedThroughput']
                prov = "-c %d,%d" % (prov['ReadCapacityUnits'], prov['WriteCapacityUnits'])
                print "create %s %s %s%s" % (name, prov, hkey, rkey)
            else:
                self.pprint(desc, "%s: " % table)