示例#1
0
// ParseAndBind parses line as if it had been read from the inputrc file and performs any key bindings and variable assignments found
// (See rl_parse_and_bind http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#IDX266)
func ParseAndBind(line string) error {
	cline := C.CString(line)
	err := C.rl_parse_and_bind(cline)
	C.free(unsafe.Pointer(cline))
	if err != 0 {
		return syscall.Errno(err)
	}
	return nil
}
示例#2
0
// Parse and execute single line of a readline init file.
func ParseAndBind(s string) {
	p := C.CString(s)
	defer C.free(unsafe.Pointer(p))
	C.rl_parse_and_bind(p)
}