forked from mirror/ledisdb
parent
5f0c295dd5
commit
2d113aa9be
|
@ -5,3 +5,4 @@ nohup.out
|
||||||
build_config.mk
|
build_config.mk
|
||||||
var*
|
var*
|
||||||
*.log
|
*.log
|
||||||
|
bin
|
10
Makefile
10
Makefile
|
@ -14,13 +14,10 @@ export GO_BUILD_TAGS
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
$(GO) install -tags '$(GO_BUILD_TAGS)' ./...
|
$(GO) install -tags 'linenoise $(GO_BUILD_TAGS)' ./...
|
||||||
|
|
||||||
build_use_lmdb:
|
build_use_lmdb:
|
||||||
$(GO) install -tags '$(GO_BUILD_TAGS) lmdb' ./...
|
$(GO) install -tags 'linenoise $(GO_BUILD_TAGS) lmdb' ./...
|
||||||
|
|
||||||
clean:
|
|
||||||
$(GO) clean -i ./...
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
$(GO) test --race -tags '$(GO_BUILD_TAGS)' ./...
|
$(GO) test --race -tags '$(GO_BUILD_TAGS)' ./...
|
||||||
|
@ -40,5 +37,8 @@ test_store:
|
||||||
test_rpl:
|
test_rpl:
|
||||||
$(GO) test --race -tags '$(GO_BUILD_TAGS)' ./rpl
|
$(GO) test --race -tags '$(GO_BUILD_TAGS)' ./rpl
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(GO) clean -i ./...
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
go 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
|
/* linenoise.c -- guerrilla line editing library against the idea that a
|
||||||
* line editing lib needs to be 20,000 lines of C code.
|
* line editing lib needs to be 20,000 lines of C code.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// +build linenoise
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
//#include <stdlib.h>
|
//#include <stdlib.h>
|
||||||
|
@ -47,21 +49,6 @@ func setHistoryCapacity(capacity int) error {
|
||||||
return nil
|
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 {
|
// typedef struct linenoiseCompletions {
|
||||||
// size_t len;
|
// size_t len;
|
||||||
// char **cvec;
|
// char **cvec;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// +build linenoise
|
||||||
|
|
||||||
/* linenoise.h -- guerrilla line editing library against the idea that a
|
/* linenoise.h -- guerrilla line editing library against the idea that a
|
||||||
* line editing lib needs to be 20,000 lines of C code.
|
* line editing lib needs to be 20,000 lines of C code.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build linenoise
|
||||||
|
|
||||||
#include "linenoiseCompletionCallbackHook.h"
|
#include "linenoiseCompletionCallbackHook.h"
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// +build linenoise
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "linenoise.h"
|
#include "linenoise.h"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// +build linenoise
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
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