forked from mirror/ledisdb
parent
5f0c295dd5
commit
2d113aa9be
|
@ -5,3 +5,4 @@ nohup.out
|
|||
build_config.mk
|
||||
var*
|
||||
*.log
|
||||
bin
|
10
Makefile
10
Makefile
|
@ -14,13 +14,10 @@ export GO_BUILD_TAGS
|
|||
all: build
|
||||
|
||||
build:
|
||||
$(GO) install -tags '$(GO_BUILD_TAGS)' ./...
|
||||
$(GO) install -tags 'linenoise $(GO_BUILD_TAGS)' ./...
|
||||
|
||||
build_use_lmdb:
|
||||
$(GO) install -tags '$(GO_BUILD_TAGS) lmdb' ./...
|
||||
|
||||
clean:
|
||||
$(GO) clean -i ./...
|
||||
$(GO) install -tags 'linenoise $(GO_BUILD_TAGS) lmdb' ./...
|
||||
|
||||
test:
|
||||
$(GO) test --race -tags '$(GO_BUILD_TAGS)' ./...
|
||||
|
@ -40,5 +37,8 @@ test_store:
|
|||
test_rpl:
|
||||
$(GO) test --race -tags '$(GO_BUILD_TAGS)' ./rpl
|
||||
|
||||
clean:
|
||||
$(GO) clean -i ./...
|
||||
|
||||
fmt:
|
||||
go fmt ./...
|
|
@ -0,0 +1,16 @@
|
|||
package main
|
||||
|
||||
// CompletionHandler provides possible completions for given input
|
||||
type CompletionHandler func(input string) []string
|
||||
|
||||
// DefaultCompletionHandler simply returns an empty slice.
|
||||
var DefaultCompletionHandler = func(input string) []string {
|
||||
return make([]string, 0)
|
||||
}
|
||||
|
||||
var complHandler = DefaultCompletionHandler
|
||||
|
||||
// SetCompletionHandler sets the CompletionHandler to be used for completion
|
||||
func SetCompletionHandler(c CompletionHandler) {
|
||||
complHandler = c
|
||||
}
|
|
@ -1,3 +1,5 @@
|
|||
// +build linenoise
|
||||
|
||||
/* linenoise.c -- guerrilla line editing library against the idea that a
|
||||
* line editing lib needs to be 20,000 lines of C code.
|
||||
*
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build linenoise
|
||||
|
||||
package main
|
||||
|
||||
//#include <stdlib.h>
|
||||
|
@ -47,21 +49,6 @@ func setHistoryCapacity(capacity int) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// CompletionHandler provides possible completions for given input
|
||||
type CompletionHandler func(input string) []string
|
||||
|
||||
// DefaultCompletionHandler simply returns an empty slice.
|
||||
var DefaultCompletionHandler = func(input string) []string {
|
||||
return make([]string, 0)
|
||||
}
|
||||
|
||||
var complHandler = DefaultCompletionHandler
|
||||
|
||||
// SetCompletionHandler sets the CompletionHandler to be used for completion
|
||||
func SetCompletionHandler(c CompletionHandler) {
|
||||
complHandler = c
|
||||
}
|
||||
|
||||
// typedef struct linenoiseCompletions {
|
||||
// size_t len;
|
||||
// char **cvec;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build linenoise
|
||||
|
||||
/* linenoise.h -- guerrilla line editing library against the idea that a
|
||||
* line editing lib needs to be 20,000 lines of C code.
|
||||
*
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// +build linenoise
|
||||
|
||||
#include "linenoiseCompletionCallbackHook.h"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
// +build linenoise
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "linenoise.h"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// +build linenoise
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// +build !linenoise
|
||||
|
||||
package main
|
||||
|
||||
func main() {
|
||||
println("Please use linenoise to build again, or use redis-cli instead")
|
||||
}
|
Loading…
Reference in New Issue