diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-10-28 16:09:13 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-11-14 17:06:23 +0000 |
commit | ec5135e5b71e0bc5d5f596e56e9818dec38e9867 (patch) | |
tree | f36557cc4c8827c4d6515cf24bf642e3db5a5fe3 /src/simplewallet/simplewallet.cpp | |
parent | move cryptonote command line options to cryptonote_core (diff) | |
download | monero-ec5135e5b71e0bc5d5f596e56e9818dec38e9867.tar.xz |
move input_line from command_line to simplewallet
It was only used there, and this removes one part of the common
dependency on libreadline
Diffstat (limited to '')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 3d8d395db..2698b709e 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -125,6 +125,19 @@ namespace const command_line::arg_descriptor< std::vector<std::string> > arg_command = {"command", ""}; + std::string input_line(const std::string& prompt) + { +#ifdef HAVE_READLINE + rdln::suspend_readline pause_readline; +#endif + std::cout << prompt; + + std::string buf; + std::getline(std::cin, buf); + + return epee::string_tools::trim(buf); + } + inline std::string interpret_rpc_response(bool ok, const std::string& status) { std::string err; |