mirror of
https://github.com/Dushistov/sdcv.git
synced 2026-03-24 21:20:23 +00:00
Compare commits
3 Commits
v0.5.5
...
cc87634df3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cc87634df3 | ||
|
|
beebb0faa7 | ||
|
|
ba4453bd83 |
@@ -27,7 +27,7 @@ if (WITH_READLINE)
|
|||||||
find_path(READLINE_INCLUDE_DIR readline/readline.h)
|
find_path(READLINE_INCLUDE_DIR readline/readline.h)
|
||||||
find_library(READLINE_LIBRARY NAMES readline)
|
find_library(READLINE_LIBRARY NAMES readline)
|
||||||
if (NOT (READLINE_INCLUDE_DIR AND READLINE_LIBRARY))
|
if (NOT (READLINE_INCLUDE_DIR AND READLINE_LIBRARY))
|
||||||
set(WITH_READLINE False CACHE FORCE)
|
set(WITH_READLINE False CACHE BOOL "No readline library found" FORCE)
|
||||||
endif ()
|
endif ()
|
||||||
endif (WITH_READLINE)
|
endif (WITH_READLINE)
|
||||||
|
|
||||||
@@ -78,15 +78,17 @@ check_include_file(locale.h HAVE_LOCALE_H)
|
|||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${ZLIB_INCLUDE_DIR}
|
${ZLIB_INCLUDE_DIR}
|
||||||
${GLIB2_INCLUDE_DIRS}
|
${GLIB2_INCLUDE_DIRS}
|
||||||
${READLINE_INCLUDE_DIR}
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lib
|
${CMAKE_CURRENT_SOURCE_DIR}/src/lib
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
if (WITH_READLINE)
|
||||||
|
include_directories(
|
||||||
|
${READLINE_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
#
|
#
|
||||||
# Packing stuff
|
# Packing stuff
|
||||||
#
|
#
|
||||||
@@ -103,12 +105,16 @@ set(sdcv_VERSION
|
|||||||
add_definitions(-DVERSION="${sdcv_VERSION}" -DHAVE_CONFIG_H)
|
add_definitions(-DVERSION="${sdcv_VERSION}" -DHAVE_CONFIG_H)
|
||||||
|
|
||||||
add_executable(sdcv ${sdcv_SRCS})
|
add_executable(sdcv ${sdcv_SRCS})
|
||||||
|
|
||||||
target_link_libraries(sdcv
|
target_link_libraries(sdcv
|
||||||
${GLIB2_LIBRARIES}
|
${GLIB2_LIBRARIES}
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
${READLINE_LIBRARY}
|
|
||||||
)
|
)
|
||||||
|
if (WITH_READLINE)
|
||||||
|
target_link_libraries(sdcv
|
||||||
|
${READLINE_LIBRARY}
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (ENABLE_NLS)
|
if (ENABLE_NLS)
|
||||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "locale")
|
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "locale")
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
@@ -415,10 +415,9 @@ search_result Library::process_phrase(const char *loc_str, IReadLine &io, bool f
|
|||||||
colorize_output_ ? ESC_END : "");
|
colorize_output_ ? ESC_END : "");
|
||||||
}
|
}
|
||||||
int choise;
|
int choise;
|
||||||
std::unique_ptr<IReadLine> choice_readline(create_readline_object());
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
std::string str_choise;
|
std::string str_choise;
|
||||||
choice_readline->read(_("Your choice[-1 to abort]: "), str_choise);
|
io.read(_("Your choice[-1 to abort]: "), str_choise);
|
||||||
sscanf(str_choise.c_str(), "%d", &choise);
|
sscanf(str_choise.c_str(), "%d", &choise);
|
||||||
if (choise >= 0 && choise < int(res_list.size())) {
|
if (choise >= 0 && choise < int(res_list.size())) {
|
||||||
sdcv_pager pager;
|
sdcv_pager pager;
|
||||||
|
|||||||
Reference in New Issue
Block a user