libcubescript/tools/edit_fallback.hh

20 lines
425 B
C++
Raw Normal View History

#ifndef CS_REPL_HAS_EDIT
/* use nothing (no line editing support) */
2017-01-30 19:38:11 +01:00
#include <optional>
#include <ostd/string.hh>
2017-06-19 20:13:54 +02:00
inline void init_lineedit(cs_state &, ostd::string_range) {
}
2017-06-19 20:13:54 +02:00
inline std::optional<std::string> read_line(cs_state &, cs_svar *pr) {
ostd::write(pr->get_value());
2020-09-11 23:41:09 +02:00
return ostd::cin.get_line(ostd::appender<std::string>()).get();
}
2017-06-19 20:13:54 +02:00
inline void add_history(cs_state &, ostd::string_range) {
}
#endif