From 082db75f28b717a01349026df42c4852a10bb932 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 28 Oct 2017 16:06:43 +0100 Subject: move cryptonote command line options to cryptonote_core Those have no reason to be in a generic module --- src/common/command_line.cpp | 45 --------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'src/common/command_line.cpp') diff --git a/src/common/command_line.cpp b/src/common/command_line.cpp index d4a28fc85..2117aa968 100644 --- a/src/common/command_line.cpp +++ b/src/common/command_line.cpp @@ -94,49 +94,4 @@ namespace command_line const arg_descriptor arg_help = {"help", "Produce help message"}; const arg_descriptor arg_version = {"version", "Output version information"}; - const arg_descriptor arg_data_dir = {"data-dir", "Specify data directory"}; - const arg_descriptor arg_testnet_data_dir = {"testnet-data-dir", "Specify testnet data directory"}; - const arg_descriptor arg_test_drop_download = {"test-drop-download", "For net tests: in download, discard ALL blocks instead checking/saving them (very fast)"}; - const arg_descriptor arg_test_drop_download_height = {"test-drop-download-height", "Like test-drop-download but disards only after around certain height", 0}; - const arg_descriptor arg_test_dbg_lock_sleep = {"test-dbg-lock-sleep", "Sleep time in ms, defaults to 0 (off), used to debug before/after locking mutex. Values 100 to 1000 are good for tests."}; - const arg_descriptor arg_testnet_on = { - "testnet" - , "Run on testnet. The wallet must be launched with --testnet flag." - , false - }; - const arg_descriptor arg_dns_checkpoints = { - "enforce-dns-checkpointing" - , "checkpoints from DNS server will be enforced" - , false - }; - const command_line::arg_descriptor arg_fast_block_sync = { - "fast-block-sync" - , "Sync up most of the way by using embedded, known block hashes." - , 1 - }; - const command_line::arg_descriptor arg_prep_blocks_threads = { - "prep-blocks-threads" - , "Max number of threads to use when preparing block hashes in groups." - , 4 - }; - const command_line::arg_descriptor arg_show_time_stats = { - "show-time-stats" - , "Show time-stats when processing blocks/txs and disk synchronization." - , 0 - }; - const command_line::arg_descriptor arg_block_sync_size = { - "block-sync-size" - , "How many blocks to sync at once during chain synchronization (0 = adaptive)." - , 0 - }; - const command_line::arg_descriptor arg_check_updates = { - "check-updates" - , "Check for new versions of monero: [disabled|notify|download|update]" - , "notify" - }; - const arg_descriptor arg_fluffy_blocks = { - "fluffy-blocks" - , "Relay blocks as fluffy blocks where possible (automatic on testnet)" - , false - }; } -- cgit v1.2.3 From ec5135e5b71e0bc5d5f596e56e9818dec38e9867 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 28 Oct 2017 16:09:13 +0100 Subject: move input_line from command_line to simplewallet It was only used there, and this removes one part of the common dependency on libreadline --- src/common/command_line.cpp | 18 ------------------ src/common/command_line.h | 2 -- src/simplewallet/simplewallet.cpp | 13 +++++++++++++ 3 files changed, 13 insertions(+), 20 deletions(-) (limited to 'src/common/command_line.cpp') diff --git a/src/common/command_line.cpp b/src/common/command_line.cpp index 2117aa968..4b9ca9559 100644 --- a/src/common/command_line.cpp +++ b/src/common/command_line.cpp @@ -36,10 +36,6 @@ #include "cryptonote_config.h" #include "string_tools.h" -#ifdef HAVE_READLINE - #include "readline_buffer.h" -#endif - namespace command_line { namespace @@ -50,20 +46,6 @@ namespace command_line } } - 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); - - } - bool is_yes(const std::string& str) { if (str == "y" || str == "Y") diff --git a/src/common/command_line.h b/src/common/command_line.h index 70242fdf3..c2bac9cc8 100644 --- a/src/common/command_line.h +++ b/src/common/command_line.h @@ -41,8 +41,6 @@ namespace command_line { - std::string input_line(const std::string& prompt); - //! \return True if `str` is `is_iequal("y" || "yes" || `tr("yes"))`. bool is_yes(const std::string& str); //! \return True if `str` is `is_iequal("n" || "no" || `tr("no"))`. 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 > 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; -- cgit v1.2.3