Esempio n. 1
0
func main() {
	//select * from
	arg.String("table", "USR01", "read from table", time.Second*55)
	arg.String("dest", "", "destination system", time.Second*55)
	arg.String("client", "", "client", time.Second*55)
	arg.String("user", "RFC", "username", time.Second*55)
	arg.String("pass", "", "password", time.Second*55)
	arg.String("lang", "DE", "language", time.Second*55)
	arg.String("host", "127.0.0.1", "SAP server", time.Second*55)
	arg.String("sysnr", "00", "SysNr", time.Second*5)
	arg.String("router", "/H/127.0.0.1/H/", "SAP router", time.Second*55)
	arg.Parse()

	SAPconnection, _ = saprfc.ConnectionFromParams(saprfc.ConnectionParameter{
		Dest:      arg.Get("dest").(string),
		Client:    arg.Get("client").(string),
		User:      arg.Get("user").(string),
		Passwd:    arg.Get("pass").(string),
		Lang:      arg.Get("lang").(string),
		Ashost:    arg.Get("host").(string),
		Sysnr:     arg.Get("sysnr").(string),
		Saprouter: arg.Get("router").(string),
	})

	printTable(arg.Get("table").(string))

	SAPconnection.Close()
}
Esempio n. 2
0
File: arg.go Progetto: tjyang/golibs
func main() {
	arg.String("name", "default", "usage string", time.Second*5)
	arg.Parse()
	fmt.Println("\ninput:", arg.Get("name"))
}