Skip to content

Commit 7dbc8b5

Browse files
committed
Merge branch 'static/linenoise'
2 parents 8cce17c + b780538 commit 7dbc8b5

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ configure_file(
4848
"${laco_SOURCE_DIR}/src/lacoconf.h.in"
4949
"${laco_BINARY_DIR}/include/lacoconf.h")
5050

51+
# for linenoise library
52+
include_directories("${laco_SOURCE_DIR}/deps/linenoise")
53+
add_subdirectory(deps)
54+
5155
add_subdirectory(src)

deps/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set(SOURCE linenoise/linenoise.c)
2+
3+
add_library(linenoise STATIC ${SOURCE})

src/CMakeLists.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
set(DEPS_DIR "${laco_SOURCE_DIR}/deps")
1+
include_directories("${laco_SOURCE_DIR}/src")
22

3-
include_directories("${laco_SOURCE_DIR}/src" "${DEPS_DIR}/linenoise")
4-
5-
set(SOURCE ${DEPS_DIR}/linenoise/linenoise.c
6-
main.c util.c util/print.c
7-
util/line.c
8-
commands/debugger.c
9-
flags.c commands.c laco.c)
3+
set(SOURCE main.c flags.c laco.c
4+
util.c util/print.c util/line.c
5+
commands.c commands/debugger.c)
106

117
add_executable(laco ${SOURCE})
12-
target_link_libraries(laco ${LACO_LUA})
8+
target_link_libraries(laco ${LACO_LUA} linenoise)
139

1410
install(TARGETS laco
1511
RUNTIME DESTINATION bin)

src/commands.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#include "util.h"
88
#include "commands/debugger.h"
99

10-
static const char* quit_matches[] = {"quit", "q"};
11-
static const char* help_matches[] = {"help", "?"};
10+
static const char* quit_matches[] = {"quit", "q", NULL};
11+
static const char* help_matches[] = {"help", "?", NULL};
1212

1313
/* Debugger commands */
14-
static const char* debug_info_matches[] = {"info"};
14+
static const char* debug_info_matches[] = {"info", NULL};
1515

1616
static void print_commands_help() {
1717
puts(" Commands available:\n");

src/flags.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ enum LacoFlags {
1010
LACO_VERSION
1111
};
1212

13-
static const char* version_matches[] = {"-v", "--version"};
14-
static const char* help_matches[] = {"-h", "-?", "--help"};
13+
static const char* version_matches[] = {"-v", "--version", NULL};
14+
static const char* help_matches[] = {"-h", "-?", "--help", NULL};
1515

1616
/* Check if the command flag is for version */
1717
static inline bool is_version(const char* arg) {

0 commit comments

Comments
 (0)