simplewallet: indicate default choice in yes/no prompts

This commit is contained in:
bsandham
2026-08-02 18:14:23 +01:00
parent 13a8b563ee
commit 9f57fa7a6a
+5 -5
View File
@@ -288,7 +288,7 @@ namespace
PAUSE_READLINE();
std::cout << prompt;
if (yesno)
std::cout << " (Y/Yes/N/No)";
std::cout << " [y/N]";
std::cout << ": " << std::flush;
std::string buf;
@@ -5189,7 +5189,7 @@ void simple_wallet::check_background_mining(const epee::wipeable_string &passwor
message_writer() << tr("The daemon is not set up to background mine.");
message_writer() << tr("With background mining enabled, the daemon will mine when idle and not on battery.");
message_writer() << tr("Enabling this supports the network you are using, and makes you eligible for receiving new monero");
std::string accepted = input_line(tr("Do you want to do it now? (Y/Yes/N/No)"));
std::string accepted = input_line(tr("Do you want to do it now?"), true);
if (std::cin.eof() || !command_line::is_yes(accepted)) {
m_wallet->setup_background_mining(tools::wallet2::BackgroundMiningNo);
m_wallet->rewrite(m_wallet_file, password);
@@ -5584,7 +5584,7 @@ void simple_wallet::on_refresh_finished(uint64_t start_height, uint64_t fetched_
// Finished first refresh for HW device and money received -> KI sync
message_writer() << "\n" << tr("The first refresh has finished for the HW-based wallet with received money. hw_key_images_sync is needed. ");
std::string accepted = input_line(tr("Do you want to do it now? (Y/Yes/N/No): "));
std::string accepted = input_line(tr("Do you want to do it now?"), true);
if (std::cin.eof() || !command_line::is_yes(accepted)) {
message_writer(console_color_red, false) << tr("hw_key_images_sync skipped. Run command manually before a transfer.");
return;
@@ -8904,7 +8904,7 @@ bool simple_wallet::rescan_blockchain(const std::vector<std::string> &args_)
if (start_height > wallet_from_height)
{
message_writer() << tr("Warning: your restore height is higher than wallet restore height: ") << wallet_from_height;
std::string confirm = input_line(tr("Rescan anyway ? (Y/Yes/N/No): "));
std::string confirm = input_line(tr("Rescan anyway?"), true);
if(!std::cin.eof())
{
if (!command_line::is_yes(confirm))
@@ -10382,7 +10382,7 @@ int main(int argc, char* argv[])
bool simple_wallet::user_confirms(const std::string &question)
{
std::string answer = input_line(question + tr(" (Y/Yes/N/No): "));
std::string answer = input_line(question, true);
return !std::cin.eof() && command_line::is_yes(answer);
}