3 # Can be used if Readline is unavailable or explicitely disabled
4 # Note that ConvertUTF.cpp is under redis-only license therefore
5 # if you are maintainer, think twice before including it
9 ZP
=linenoise-ng-
$version
10 if [ ! -f "${ZP}.zip" ]; then
11 wget
-O "${ZP}.zip" https
://github.com
/arangodb
/linenoise-ng
/archive
/v
$version.
zip
13 unzip -o -j "${ZP}.zip" $ZP/src
/ConvertUTF.cpp
$ZP/src
/ConvertUTF.h
$ZP/LICENSE
$ZP/src
/linenoise.cpp
$ZP/include
/linenoise.h
$ZP/README.md
$ZP/src
/wcwidth.cpp
-d linenoise
14 #echo "Please do make style"
16 echo "Generating linenoise.cmake..."
17 cat > linenoise.cmake
<< EOF
18 add_library(pm3rrg_rdv4_linenoise STATIC
19 linenoise/ConvertUTF.cpp
20 linenoise/linenoise.cpp
24 target_compile_definitions(pm3rrg_rdv4_linenoise PRIVATE NDEBUG)
25 target_include_directories(pm3rrg_rdv4_linenoise INTERFACE linenoise)
26 target_compile_options(pm3rrg_rdv4_linenoise PRIVATE -Wall -Werror -O3)
27 set_property(TARGET pm3rrg_rdv4_linenoise PROPERTY POSITION_INDEPENDENT_CODE ON)
31 echo "Generating linenoise/Makefile..."
35 MYCXXFLAGS = -DNDEBUG -std=c++11 -fomit-frame-pointer
37 MYCXXSRCS = ConvertUTF.cpp linenoise.cpp wcwidth.cpp
39 LIB_A = liblinenoise.a
41 include ../../../Makefile.host
44 # Patch to get proper autocompletion of subcommands
46 diff -Naur linenoise.cpp linenoise.cpp
47 +++ linenoise.cpp 2017-03-06 17:01:33.000000000 +0100
48 --- linenoise.cpp 2022-01-29 10:37:19.656202922 +0100
51 // extract a copy to parse. we also handle the case where tab is hit while
52 // not at end-of-line.
53 - int startIndex = pos;
55 while (--startIndex >= 0) {
56 if (strchr(breakChars, buf32[startIndex])) {