#!/usr/bin/env python

import sys
import argparse
import client_wrap

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument("-t", "--type", help="type of the cached data", default="double")
    parser.add_argument("-c", "--connection", help="connection string", default="ipc:///var/run/zero-cache/0")
    parser.add_argument("-w", "--column", help="number of columns", type=int, default=1)
    parser.add_argument("-l", "--log", help="log file name", default="")
    args = parser.parse_args()

def get_keys(client):
    key_str = client.GetKeys()
    keys = key_str.split (';')
    del keys[-1]

    if len(keys) == 0:
        sys.exit()

    return keys

def print_keys(client, keys):
    for key in keys:
        value = client.ReadLong(key)
        print "%s = %d" % (key, value)

def main():
    parse_args()
    client = client_wrap.ClientWrap("get_test.log", "ipc:///var/run/zero-cache/0", 0)
    keys = get_keys(client)
    print_keys(client, keys)

if __name__ == "__main__":
    main()

@@ -487,20 +487,36 @@
 %22%22)%0A    
-args
+global ARGS%0A    ARGS
  = parse
@@ -697,26 +697,26 @@
 ys%0A%0Adef 
-print_keys
+read_value
 (client,
@@ -723,69 +723,410 @@
  key
-s
 ):%0A    
-for key in keys:%0A        value = client.ReadLong(key)
+if ARGS.type == %22double%22:%0A        return client.ReadDouble(key)%0A%0A    if ARGS.type == %22long%22:%0A        return client.ReadLong(key)%0A%0A    if ARGS.type == %22string%22:%0A        return client.ReadString(key)%0A%0Adef print_value(key, value):%0A    if ARGS.type == %22double%22:%0A        print %22%25s = %25f%22 %25 (key, value)%0A%0A    if ARGS.type == %22long%22:%0A        print %22%25s = %25d%22 %25 (key, value)%0A%0A    if ARGS.type == %22string%22:
 %0A   
@@ -1135,33 +1135,33 @@
    print %22%25s = %25
-d
+s
 %22 %25 (key, value)
@@ -1162,16 +1162,140 @@
 value)%0A%0A
+def print_keys(client, keys):%0A    for key in keys:%0A        value = read_value(client, key)%0A        print_value(key, value)%0A%0A
 def main

Implement the type specific values output