// opens a hive connection
func (conn *HiveConnection) Open() error {

	log.Println("creating new hive connection ")
	var transport thrift.TTransport
	var err error
	transport, err = thrift.NewTSocket(conn.Server)
	if err != nil {
		return err
	}
	if transport == nil {
		return errors.New("No TSocket connection?")
	}

	transport.Open()

	// NewTBinaryProtocolTransport(t TTransport) *TBinaryProtocol {
	protocolfac := thrift.NewTBinaryProtocolFactoryDefault()

	//NewThriftHiveClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol)
	conn.Client = thrifthive.NewThriftHiveClientFactory(transport, protocolfac)

	log.Printf("is open? %v", transport.IsOpen())
	name, err := conn.Client.GetName()
	log.Printf("in conn.Open, how is client? %v %v", name, err)

	if conn.Client == nil {
		log.Println("ERROR, no client")
		return errors.New("no client")
	}

	return nil
}
func main() {
	flag.Usage = Usage
	var host string
	var port int
	var protocol string
	var urlString string
	var framed bool
	var useHttp bool
	var parsedUrl url.URL
	var trans thrift.TTransport
	_ = math.MinInt32 // will become unneeded eventually
	_ = strconv.Atoi
	flag.Usage = Usage
	flag.StringVar(&host, "h", "localhost", "Specify host and port")
	flag.IntVar(&port, "p", 9090, "Specify port")
	flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)")
	flag.StringVar(&urlString, "u", "", "Specify the url")
	flag.BoolVar(&framed, "framed", false, "Use framed transport")
	flag.BoolVar(&useHttp, "http", false, "Use http")
	flag.Parse()

	if len(urlString) > 0 {
		parsedUrl, err := url.Parse(urlString)
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
		host = parsedUrl.Host
		useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http"
	} else if useHttp {
		_, err := url.Parse(fmt.Sprint("http://", host, ":", port))
		if err != nil {
			fmt.Fprintln(os.Stderr, "Error parsing URL: ", err)
			flag.Usage()
		}
	}

	cmd := flag.Arg(0)
	var err error
	if useHttp {
		trans, err = thrift.NewTHttpClient(parsedUrl.String())
	} else {
		portStr := fmt.Sprint(port)
		if strings.Contains(host, ":") {
			host, portStr, err = net.SplitHostPort(host)
			if err != nil {
				fmt.Fprintln(os.Stderr, "error with host:", err)
				os.Exit(1)
			}
		}
		trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))
		if err != nil {
			fmt.Fprintln(os.Stderr, "error resolving address:", err)
			os.Exit(1)
		}
		if framed {
			trans = thrift.NewTFramedTransport(trans)
		}
	}
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error creating transport", err)
		os.Exit(1)
	}
	defer trans.Close()
	var protocolFactory thrift.TProtocolFactory
	switch protocol {
	case "compact":
		protocolFactory = thrift.NewTCompactProtocolFactory()
		break
	case "simplejson":
		protocolFactory = thrift.NewTSimpleJSONProtocolFactory()
		break
	case "json":
		protocolFactory = thrift.NewTJSONProtocolFactory()
		break
	case "binary", "":
		protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol)
		Usage()
		os.Exit(1)
	}
	client := hive_service.NewThriftHiveClientFactory(trans, protocolFactory)
	if err := trans.Open(); err != nil {
		fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err)
		os.Exit(1)
	}

	switch cmd {
	case "execute":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "Execute requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.Execute(value0))
		fmt.Print("\n")
		break
	case "fetchOne":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "FetchOne requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.FetchOne())
		fmt.Print("\n")
		break
	case "fetchN":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "FetchN requires 1 args")
			flag.Usage()
		}
		tmp0, err40 := (strconv.Atoi(flag.Arg(1)))
		if err40 != nil {
			Usage()
			return
		}
		argvalue0 := int32(tmp0)
		value0 := argvalue0
		fmt.Print(client.FetchN(value0))
		fmt.Print("\n")
		break
	case "fetchAll":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "FetchAll requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.FetchAll())
		fmt.Print("\n")
		break
	case "getSchema":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetSchema requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetSchema())
		fmt.Print("\n")
		break
	case "getThriftSchema":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetThriftSchema requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetThriftSchema())
		fmt.Print("\n")
		break
	case "getClusterStatus":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetClusterStatus requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetClusterStatus())
		fmt.Print("\n")
		break
	case "getQueryPlan":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetQueryPlan requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetQueryPlan())
		fmt.Print("\n")
		break
	case "clean":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "Clean requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.Clean())
		fmt.Print("\n")
		break
	case "create_database":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "CreateDatabase requires 1 args")
			flag.Usage()
		}
		arg41 := flag.Arg(1)
		mbTrans42 := thrift.NewTMemoryBufferLen(len(arg41))
		defer mbTrans42.Close()
		_, err43 := mbTrans42.WriteString(arg41)
		if err43 != nil {
			Usage()
			return
		}
		factory44 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt45 := factory44.GetProtocol(mbTrans42)
		argvalue0 := hive_service.NewDatabase()
		err46 := argvalue0.Read(jsProt45)
		if err46 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.CreateDatabase(value0))
		fmt.Print("\n")
		break
	case "get_database":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetDatabase requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetDatabase(value0))
		fmt.Print("\n")
		break
	case "drop_database":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "DropDatabase requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2) == "true"
		value1 := argvalue1
		fmt.Print(client.DropDatabase(value0, value1))
		fmt.Print("\n")
		break
	case "get_databases":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetDatabases requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetDatabases(value0))
		fmt.Print("\n")
		break
	case "get_all_databases":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetAllDatabases requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetAllDatabases())
		fmt.Print("\n")
		break
	case "alter_database":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "AlterDatabase requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		arg52 := flag.Arg(2)
		mbTrans53 := thrift.NewTMemoryBufferLen(len(arg52))
		defer mbTrans53.Close()
		_, err54 := mbTrans53.WriteString(arg52)
		if err54 != nil {
			Usage()
			return
		}
		factory55 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt56 := factory55.GetProtocol(mbTrans53)
		argvalue1 := hive_service.NewDatabase()
		err57 := argvalue1.Read(jsProt56)
		if err57 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.AlterDatabase(value0, value1))
		fmt.Print("\n")
		break
	case "get_type":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetType requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetType(value0))
		fmt.Print("\n")
		break
	case "create_type":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "CreateType requires 1 args")
			flag.Usage()
		}
		arg59 := flag.Arg(1)
		mbTrans60 := thrift.NewTMemoryBufferLen(len(arg59))
		defer mbTrans60.Close()
		_, err61 := mbTrans60.WriteString(arg59)
		if err61 != nil {
			Usage()
			return
		}
		factory62 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt63 := factory62.GetProtocol(mbTrans60)
		argvalue0 := hive_service.NewType()
		err64 := argvalue0.Read(jsProt63)
		if err64 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.CreateType(value0))
		fmt.Print("\n")
		break
	case "drop_type":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "DropType requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.DropType(value0))
		fmt.Print("\n")
		break
	case "get_type_all":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetTypeAll requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetTypeAll(value0))
		fmt.Print("\n")
		break
	case "get_fields":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetFields requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.GetFields(value0, value1))
		fmt.Print("\n")
		break
	case "get_schema":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetSchema requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.GetSchema(value0, value1))
		fmt.Print("\n")
		break
	case "create_table":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "CreateTable requires 1 args")
			flag.Usage()
		}
		arg71 := flag.Arg(1)
		mbTrans72 := thrift.NewTMemoryBufferLen(len(arg71))
		defer mbTrans72.Close()
		_, err73 := mbTrans72.WriteString(arg71)
		if err73 != nil {
			Usage()
			return
		}
		factory74 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt75 := factory74.GetProtocol(mbTrans72)
		argvalue0 := hive_service.NewTable()
		err76 := argvalue0.Read(jsProt75)
		if err76 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.CreateTable(value0))
		fmt.Print("\n")
		break
	case "drop_table":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "DropTable requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		argvalue2 := flag.Arg(3) == "true"
		value2 := argvalue2
		fmt.Print(client.DropTable(value0, value1, value2))
		fmt.Print("\n")
		break
	case "get_tables":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetTables requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.GetTables(value0, value1))
		fmt.Print("\n")
		break
	case "get_all_tables":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetAllTables requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetAllTables(value0))
		fmt.Print("\n")
		break
	case "get_table":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetTable requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.GetTable(value0, value1))
		fmt.Print("\n")
		break
	case "alter_table":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "AlterTable requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg87 := flag.Arg(3)
		mbTrans88 := thrift.NewTMemoryBufferLen(len(arg87))
		defer mbTrans88.Close()
		_, err89 := mbTrans88.WriteString(arg87)
		if err89 != nil {
			Usage()
			return
		}
		factory90 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt91 := factory90.GetProtocol(mbTrans88)
		argvalue2 := hive_service.NewTable()
		err92 := argvalue2.Read(jsProt91)
		if err92 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.AlterTable(value0, value1, value2))
		fmt.Print("\n")
		break
	case "add_partition":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "AddPartition requires 1 args")
			flag.Usage()
		}
		arg93 := flag.Arg(1)
		mbTrans94 := thrift.NewTMemoryBufferLen(len(arg93))
		defer mbTrans94.Close()
		_, err95 := mbTrans94.WriteString(arg93)
		if err95 != nil {
			Usage()
			return
		}
		factory96 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt97 := factory96.GetProtocol(mbTrans94)
		argvalue0 := hive_service.NewPartition()
		err98 := argvalue0.Read(jsProt97)
		if err98 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.AddPartition(value0))
		fmt.Print("\n")
		break
	case "append_partition":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "AppendPartition requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg101 := flag.Arg(3)
		mbTrans102 := thrift.NewTMemoryBufferLen(len(arg101))
		defer mbTrans102.Close()
		_, err103 := mbTrans102.WriteString(arg101)
		if err103 != nil {
			Usage()
			return
		}
		factory104 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt105 := factory104.GetProtocol(mbTrans102)
		containerStruct2 := hive_service.NewAppendPartitionArgs()
		err106 := containerStruct2.ReadField3(jsProt105)
		if err106 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.PartVals
		value2 := argvalue2
		fmt.Print(client.AppendPartition(value0, value1, value2))
		fmt.Print("\n")
		break
	case "append_partition_by_name":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "AppendPartitionByName requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		fmt.Print(client.AppendPartitionByName(value0, value1, value2))
		fmt.Print("\n")
		break
	case "drop_partition":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "DropPartition requires 4 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg112 := flag.Arg(3)
		mbTrans113 := thrift.NewTMemoryBufferLen(len(arg112))
		defer mbTrans113.Close()
		_, err114 := mbTrans113.WriteString(arg112)
		if err114 != nil {
			Usage()
			return
		}
		factory115 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt116 := factory115.GetProtocol(mbTrans113)
		containerStruct2 := hive_service.NewDropPartitionArgs()
		err117 := containerStruct2.ReadField3(jsProt116)
		if err117 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.PartVals
		value2 := argvalue2
		argvalue3 := flag.Arg(4) == "true"
		value3 := argvalue3
		fmt.Print(client.DropPartition(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "drop_partition_by_name":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "DropPartitionByName requires 4 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		argvalue3 := flag.Arg(4) == "true"
		value3 := argvalue3
		fmt.Print(client.DropPartitionByName(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "get_partition":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetPartition requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg125 := flag.Arg(3)
		mbTrans126 := thrift.NewTMemoryBufferLen(len(arg125))
		defer mbTrans126.Close()
		_, err127 := mbTrans126.WriteString(arg125)
		if err127 != nil {
			Usage()
			return
		}
		factory128 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt129 := factory128.GetProtocol(mbTrans126)
		containerStruct2 := hive_service.NewGetPartitionArgs()
		err130 := containerStruct2.ReadField3(jsProt129)
		if err130 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.PartVals
		value2 := argvalue2
		fmt.Print(client.GetPartition(value0, value1, value2))
		fmt.Print("\n")
		break
	case "get_partition_with_auth":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "GetPartitionWithAuth requires 5 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg133 := flag.Arg(3)
		mbTrans134 := thrift.NewTMemoryBufferLen(len(arg133))
		defer mbTrans134.Close()
		_, err135 := mbTrans134.WriteString(arg133)
		if err135 != nil {
			Usage()
			return
		}
		factory136 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt137 := factory136.GetProtocol(mbTrans134)
		containerStruct2 := hive_service.NewGetPartitionWithAuthArgs()
		err138 := containerStruct2.ReadField3(jsProt137)
		if err138 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.PartVals
		value2 := argvalue2
		argvalue3 := flag.Arg(4)
		value3 := argvalue3
		arg140 := flag.Arg(5)
		mbTrans141 := thrift.NewTMemoryBufferLen(len(arg140))
		defer mbTrans141.Close()
		_, err142 := mbTrans141.WriteString(arg140)
		if err142 != nil {
			Usage()
			return
		}
		factory143 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt144 := factory143.GetProtocol(mbTrans141)
		containerStruct4 := hive_service.NewGetPartitionWithAuthArgs()
		err145 := containerStruct4.ReadField5(jsProt144)
		if err145 != nil {
			Usage()
			return
		}
		argvalue4 := containerStruct4.GroupNames
		value4 := argvalue4
		fmt.Print(client.GetPartitionWithAuth(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "get_partition_by_name":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetPartitionByName requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		fmt.Print(client.GetPartitionByName(value0, value1, value2))
		fmt.Print("\n")
		break
	case "get_partitions":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetPartitions requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		tmp2, err151 := (strconv.Atoi(flag.Arg(3)))
		if err151 != nil {
			Usage()
			return
		}
		argvalue2 := byte(tmp2)
		value2 := argvalue2
		fmt.Print(client.GetPartitions(value0, value1, value2))
		fmt.Print("\n")
		break
	case "get_partitions_with_auth":
		if flag.NArg()-1 != 5 {
			fmt.Fprintln(os.Stderr, "GetPartitionsWithAuth requires 5 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		tmp2, err154 := (strconv.Atoi(flag.Arg(3)))
		if err154 != nil {
			Usage()
			return
		}
		argvalue2 := byte(tmp2)
		value2 := argvalue2
		argvalue3 := flag.Arg(4)
		value3 := argvalue3
		arg156 := flag.Arg(5)
		mbTrans157 := thrift.NewTMemoryBufferLen(len(arg156))
		defer mbTrans157.Close()
		_, err158 := mbTrans157.WriteString(arg156)
		if err158 != nil {
			Usage()
			return
		}
		factory159 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt160 := factory159.GetProtocol(mbTrans157)
		containerStruct4 := hive_service.NewGetPartitionsWithAuthArgs()
		err161 := containerStruct4.ReadField5(jsProt160)
		if err161 != nil {
			Usage()
			return
		}
		argvalue4 := containerStruct4.GroupNames
		value4 := argvalue4
		fmt.Print(client.GetPartitionsWithAuth(value0, value1, value2, value3, value4))
		fmt.Print("\n")
		break
	case "get_partition_names":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetPartitionNames requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		tmp2, err164 := (strconv.Atoi(flag.Arg(3)))
		if err164 != nil {
			Usage()
			return
		}
		argvalue2 := byte(tmp2)
		value2 := argvalue2
		fmt.Print(client.GetPartitionNames(value0, value1, value2))
		fmt.Print("\n")
		break
	case "get_partitions_ps":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "GetPartitionsPs requires 4 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg167 := flag.Arg(3)
		mbTrans168 := thrift.NewTMemoryBufferLen(len(arg167))
		defer mbTrans168.Close()
		_, err169 := mbTrans168.WriteString(arg167)
		if err169 != nil {
			Usage()
			return
		}
		factory170 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt171 := factory170.GetProtocol(mbTrans168)
		containerStruct2 := hive_service.NewGetPartitionsPsArgs()
		err172 := containerStruct2.ReadField3(jsProt171)
		if err172 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.PartVals
		value2 := argvalue2
		tmp3, err173 := (strconv.Atoi(flag.Arg(4)))
		if err173 != nil {
			Usage()
			return
		}
		argvalue3 := byte(tmp3)
		value3 := argvalue3
		fmt.Print(client.GetPartitionsPs(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "get_partitions_ps_with_auth":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "GetPartitionsPsWithAuth requires 6 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg176 := flag.Arg(3)
		mbTrans177 := thrift.NewTMemoryBufferLen(len(arg176))
		defer mbTrans177.Close()
		_, err178 := mbTrans177.WriteString(arg176)
		if err178 != nil {
			Usage()
			return
		}
		factory179 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt180 := factory179.GetProtocol(mbTrans177)
		containerStruct2 := hive_service.NewGetPartitionsPsWithAuthArgs()
		err181 := containerStruct2.ReadField3(jsProt180)
		if err181 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.PartVals
		value2 := argvalue2
		tmp3, err182 := (strconv.Atoi(flag.Arg(4)))
		if err182 != nil {
			Usage()
			return
		}
		argvalue3 := byte(tmp3)
		value3 := argvalue3
		argvalue4 := flag.Arg(5)
		value4 := argvalue4
		arg184 := flag.Arg(6)
		mbTrans185 := thrift.NewTMemoryBufferLen(len(arg184))
		defer mbTrans185.Close()
		_, err186 := mbTrans185.WriteString(arg184)
		if err186 != nil {
			Usage()
			return
		}
		factory187 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt188 := factory187.GetProtocol(mbTrans185)
		containerStruct5 := hive_service.NewGetPartitionsPsWithAuthArgs()
		err189 := containerStruct5.ReadField6(jsProt188)
		if err189 != nil {
			Usage()
			return
		}
		argvalue5 := containerStruct5.GroupNames
		value5 := argvalue5
		fmt.Print(client.GetPartitionsPsWithAuth(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "get_partition_names_ps":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "GetPartitionNamesPs requires 4 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg192 := flag.Arg(3)
		mbTrans193 := thrift.NewTMemoryBufferLen(len(arg192))
		defer mbTrans193.Close()
		_, err194 := mbTrans193.WriteString(arg192)
		if err194 != nil {
			Usage()
			return
		}
		factory195 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt196 := factory195.GetProtocol(mbTrans193)
		containerStruct2 := hive_service.NewGetPartitionNamesPsArgs()
		err197 := containerStruct2.ReadField3(jsProt196)
		if err197 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.PartVals
		value2 := argvalue2
		tmp3, err198 := (strconv.Atoi(flag.Arg(4)))
		if err198 != nil {
			Usage()
			return
		}
		argvalue3 := byte(tmp3)
		value3 := argvalue3
		fmt.Print(client.GetPartitionNamesPs(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "get_partitions_by_filter":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "GetPartitionsByFilter requires 4 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		tmp3, err202 := (strconv.Atoi(flag.Arg(4)))
		if err202 != nil {
			Usage()
			return
		}
		argvalue3 := byte(tmp3)
		value3 := argvalue3
		fmt.Print(client.GetPartitionsByFilter(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "alter_partition":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "AlterPartition requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg205 := flag.Arg(3)
		mbTrans206 := thrift.NewTMemoryBufferLen(len(arg205))
		defer mbTrans206.Close()
		_, err207 := mbTrans206.WriteString(arg205)
		if err207 != nil {
			Usage()
			return
		}
		factory208 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt209 := factory208.GetProtocol(mbTrans206)
		argvalue2 := hive_service.NewPartition()
		err210 := argvalue2.Read(jsProt209)
		if err210 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.AlterPartition(value0, value1, value2))
		fmt.Print("\n")
		break
	case "get_config_value":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetConfigValue requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.GetConfigValue(value0, value1))
		fmt.Print("\n")
		break
	case "partition_name_to_vals":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "PartitionNameToVals requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.PartitionNameToVals(value0))
		fmt.Print("\n")
		break
	case "partition_name_to_spec":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "PartitionNameToSpec requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.PartitionNameToSpec(value0))
		fmt.Print("\n")
		break
	case "add_index":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "AddIndex requires 2 args")
			flag.Usage()
		}
		arg215 := flag.Arg(1)
		mbTrans216 := thrift.NewTMemoryBufferLen(len(arg215))
		defer mbTrans216.Close()
		_, err217 := mbTrans216.WriteString(arg215)
		if err217 != nil {
			Usage()
			return
		}
		factory218 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt219 := factory218.GetProtocol(mbTrans216)
		argvalue0 := hive_service.NewIndex()
		err220 := argvalue0.Read(jsProt219)
		if err220 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		arg221 := flag.Arg(2)
		mbTrans222 := thrift.NewTMemoryBufferLen(len(arg221))
		defer mbTrans222.Close()
		_, err223 := mbTrans222.WriteString(arg221)
		if err223 != nil {
			Usage()
			return
		}
		factory224 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt225 := factory224.GetProtocol(mbTrans222)
		argvalue1 := hive_service.NewTable()
		err226 := argvalue1.Read(jsProt225)
		if err226 != nil {
			Usage()
			return
		}
		value1 := argvalue1
		fmt.Print(client.AddIndex(value0, value1))
		fmt.Print("\n")
		break
	case "alter_index":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "AlterIndex requires 4 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		arg230 := flag.Arg(4)
		mbTrans231 := thrift.NewTMemoryBufferLen(len(arg230))
		defer mbTrans231.Close()
		_, err232 := mbTrans231.WriteString(arg230)
		if err232 != nil {
			Usage()
			return
		}
		factory233 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt234 := factory233.GetProtocol(mbTrans231)
		argvalue3 := hive_service.NewIndex()
		err235 := argvalue3.Read(jsProt234)
		if err235 != nil {
			Usage()
			return
		}
		value3 := argvalue3
		fmt.Print(client.AlterIndex(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "drop_index_by_name":
		if flag.NArg()-1 != 4 {
			fmt.Fprintln(os.Stderr, "DropIndexByName requires 4 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		argvalue3 := flag.Arg(4) == "true"
		value3 := argvalue3
		fmt.Print(client.DropIndexByName(value0, value1, value2, value3))
		fmt.Print("\n")
		break
	case "get_index_by_name":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetIndexByName requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		argvalue2 := flag.Arg(3)
		value2 := argvalue2
		fmt.Print(client.GetIndexByName(value0, value1, value2))
		fmt.Print("\n")
		break
	case "get_indexes":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetIndexes requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		tmp2, err245 := (strconv.Atoi(flag.Arg(3)))
		if err245 != nil {
			Usage()
			return
		}
		argvalue2 := byte(tmp2)
		value2 := argvalue2
		fmt.Print(client.GetIndexes(value0, value1, value2))
		fmt.Print("\n")
		break
	case "get_index_names":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetIndexNames requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		tmp2, err248 := (strconv.Atoi(flag.Arg(3)))
		if err248 != nil {
			Usage()
			return
		}
		argvalue2 := byte(tmp2)
		value2 := argvalue2
		fmt.Print(client.GetIndexNames(value0, value1, value2))
		fmt.Print("\n")
		break
	case "create_role":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "CreateRole requires 1 args")
			flag.Usage()
		}
		arg249 := flag.Arg(1)
		mbTrans250 := thrift.NewTMemoryBufferLen(len(arg249))
		defer mbTrans250.Close()
		_, err251 := mbTrans250.WriteString(arg249)
		if err251 != nil {
			Usage()
			return
		}
		factory252 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt253 := factory252.GetProtocol(mbTrans250)
		argvalue0 := hive_service.NewRole()
		err254 := argvalue0.Read(jsProt253)
		if err254 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.CreateRole(value0))
		fmt.Print("\n")
		break
	case "drop_role":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "DropRole requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.DropRole(value0))
		fmt.Print("\n")
		break
	case "get_role_names":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetRoleNames requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetRoleNames())
		fmt.Print("\n")
		break
	case "grant_role":
		if flag.NArg()-1 != 6 {
			fmt.Fprintln(os.Stderr, "GrantRole requires 6 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := hive_service.PrincipalType(tmp2)
		value2 := argvalue2
		argvalue3 := flag.Arg(4)
		value3 := argvalue3
		tmp4, err := (strconv.Atoi(flag.Arg(5)))
		if err != nil {
			Usage()
			return
		}
		argvalue4 := hive_service.PrincipalType(tmp4)
		value4 := argvalue4
		argvalue5 := flag.Arg(6) == "true"
		value5 := argvalue5
		fmt.Print(client.GrantRole(value0, value1, value2, value3, value4, value5))
		fmt.Print("\n")
		break
	case "revoke_role":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "RevokeRole requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		tmp2, err := (strconv.Atoi(flag.Arg(3)))
		if err != nil {
			Usage()
			return
		}
		argvalue2 := hive_service.PrincipalType(tmp2)
		value2 := argvalue2
		fmt.Print(client.RevokeRole(value0, value1, value2))
		fmt.Print("\n")
		break
	case "list_roles":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "ListRoles requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := hive_service.PrincipalType(tmp1)
		value1 := argvalue1
		fmt.Print(client.ListRoles(value0, value1))
		fmt.Print("\n")
		break
	case "get_privilege_set":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "GetPrivilegeSet requires 3 args")
			flag.Usage()
		}
		arg263 := flag.Arg(1)
		mbTrans264 := thrift.NewTMemoryBufferLen(len(arg263))
		defer mbTrans264.Close()
		_, err265 := mbTrans264.WriteString(arg263)
		if err265 != nil {
			Usage()
			return
		}
		factory266 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt267 := factory266.GetProtocol(mbTrans264)
		argvalue0 := hive_service.NewHiveObjectRef()
		err268 := argvalue0.Read(jsProt267)
		if err268 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		arg270 := flag.Arg(3)
		mbTrans271 := thrift.NewTMemoryBufferLen(len(arg270))
		defer mbTrans271.Close()
		_, err272 := mbTrans271.WriteString(arg270)
		if err272 != nil {
			Usage()
			return
		}
		factory273 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt274 := factory273.GetProtocol(mbTrans271)
		containerStruct2 := hive_service.NewGetPrivilegeSetArgs()
		err275 := containerStruct2.ReadField3(jsProt274)
		if err275 != nil {
			Usage()
			return
		}
		argvalue2 := containerStruct2.GroupNames
		value2 := argvalue2
		fmt.Print(client.GetPrivilegeSet(value0, value1, value2))
		fmt.Print("\n")
		break
	case "list_privileges":
		if flag.NArg()-1 != 3 {
			fmt.Fprintln(os.Stderr, "ListPrivileges requires 3 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		tmp1, err := (strconv.Atoi(flag.Arg(2)))
		if err != nil {
			Usage()
			return
		}
		argvalue1 := hive_service.PrincipalType(tmp1)
		value1 := argvalue1
		arg277 := flag.Arg(3)
		mbTrans278 := thrift.NewTMemoryBufferLen(len(arg277))
		defer mbTrans278.Close()
		_, err279 := mbTrans278.WriteString(arg277)
		if err279 != nil {
			Usage()
			return
		}
		factory280 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt281 := factory280.GetProtocol(mbTrans278)
		argvalue2 := hive_service.NewHiveObjectRef()
		err282 := argvalue2.Read(jsProt281)
		if err282 != nil {
			Usage()
			return
		}
		value2 := argvalue2
		fmt.Print(client.ListPrivileges(value0, value1, value2))
		fmt.Print("\n")
		break
	case "grant_privileges":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GrantPrivileges requires 1 args")
			flag.Usage()
		}
		arg283 := flag.Arg(1)
		mbTrans284 := thrift.NewTMemoryBufferLen(len(arg283))
		defer mbTrans284.Close()
		_, err285 := mbTrans284.WriteString(arg283)
		if err285 != nil {
			Usage()
			return
		}
		factory286 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt287 := factory286.GetProtocol(mbTrans284)
		argvalue0 := hive_service.NewPrivilegeBag()
		err288 := argvalue0.Read(jsProt287)
		if err288 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.GrantPrivileges(value0))
		fmt.Print("\n")
		break
	case "revoke_privileges":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "RevokePrivileges requires 1 args")
			flag.Usage()
		}
		arg289 := flag.Arg(1)
		mbTrans290 := thrift.NewTMemoryBufferLen(len(arg289))
		defer mbTrans290.Close()
		_, err291 := mbTrans290.WriteString(arg289)
		if err291 != nil {
			Usage()
			return
		}
		factory292 := thrift.NewTSimpleJSONProtocolFactory()
		jsProt293 := factory292.GetProtocol(mbTrans290)
		argvalue0 := hive_service.NewPrivilegeBag()
		err294 := argvalue0.Read(jsProt293)
		if err294 != nil {
			Usage()
			return
		}
		value0 := argvalue0
		fmt.Print(client.RevokePrivileges(value0))
		fmt.Print("\n")
		break
	case "get_delegation_token":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetDelegationToken requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetDelegationToken(value0))
		fmt.Print("\n")
		break
	case "get_delegation_token_with_signature":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "GetDelegationTokenWithSignature requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.GetDelegationTokenWithSignature(value0, value1))
		fmt.Print("\n")
		break
	case "renew_delegation_token":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "RenewDelegationToken requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.RenewDelegationToken(value0))
		fmt.Print("\n")
		break
	case "cancel_delegation_token":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "CancelDelegationToken requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.CancelDelegationToken(value0))
		fmt.Print("\n")
		break
	case "getName":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetName requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetName())
		fmt.Print("\n")
		break
	case "getVersion":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetVersion requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetVersion())
		fmt.Print("\n")
		break
	case "getStatus":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetStatus requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetStatus())
		fmt.Print("\n")
		break
	case "getStatusDetails":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetStatusDetails requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetStatusDetails())
		fmt.Print("\n")
		break
	case "getCounters":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetCounters requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetCounters())
		fmt.Print("\n")
		break
	case "getCounter":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetCounter requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetCounter(value0))
		fmt.Print("\n")
		break
	case "setOption":
		if flag.NArg()-1 != 2 {
			fmt.Fprintln(os.Stderr, "SetOption requires 2 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		argvalue1 := flag.Arg(2)
		value1 := argvalue1
		fmt.Print(client.SetOption(value0, value1))
		fmt.Print("\n")
		break
	case "getOption":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetOption requires 1 args")
			flag.Usage()
		}
		argvalue0 := flag.Arg(1)
		value0 := argvalue0
		fmt.Print(client.GetOption(value0))
		fmt.Print("\n")
		break
	case "getOptions":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "GetOptions requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.GetOptions())
		fmt.Print("\n")
		break
	case "getCpuProfile":
		if flag.NArg()-1 != 1 {
			fmt.Fprintln(os.Stderr, "GetCpuProfile requires 1 args")
			flag.Usage()
		}
		tmp0, err304 := (strconv.Atoi(flag.Arg(1)))
		if err304 != nil {
			Usage()
			return
		}
		argvalue0 := int32(tmp0)
		value0 := argvalue0
		fmt.Print(client.GetCpuProfile(value0))
		fmt.Print("\n")
		break
	case "aliveSince":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "AliveSince requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.AliveSince())
		fmt.Print("\n")
		break
	case "reinitialize":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "Reinitialize requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.Reinitialize())
		fmt.Print("\n")
		break
	case "shutdown":
		if flag.NArg()-1 != 0 {
			fmt.Fprintln(os.Stderr, "Shutdown requires 0 args")
			flag.Usage()
		}
		fmt.Print(client.Shutdown())
		fmt.Print("\n")
		break
	case "":
		Usage()
		break
	default:
		fmt.Fprintln(os.Stderr, "Invalid function ", cmd)
	}
}