mirror of
https://github.com/monero-project/monero.git
synced 2026-01-14 13:56:43 -08:00
DRY cin input_line (and test replacement of non-DRY usage)
This commit is contained in:
@@ -3,9 +3,21 @@
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include "command_line.h"
|
||||
#include "string_tools.h"
|
||||
|
||||
namespace command_line
|
||||
{
|
||||
std::string input_line(const std::string& prompt)
|
||||
{
|
||||
std::cout << prompt;
|
||||
|
||||
std::string buf;
|
||||
std::getline(std::cin, buf);
|
||||
|
||||
return epee::string_tools::trim(buf);
|
||||
|
||||
}
|
||||
|
||||
const arg_descriptor<bool> arg_help = {"help", "Produce help message"};
|
||||
const arg_descriptor<bool> arg_version = {"version", "Output version information"};
|
||||
const arg_descriptor<std::string> arg_data_dir = {"data-dir", "Specify data directory"};
|
||||
|
||||
Reference in New Issue
Block a user