Added nicer (Y/n) prompt

This commit is contained in:
Jack Andersen 2015-09-01 09:17:21 -10:00
parent af2f2158bb
commit c9a295b092
1 changed files with 5 additions and 3 deletions

View File

@ -3,6 +3,7 @@
#include "ToolBase.hpp"
#include <stdio.h>
#include <conio.h>
class ToolExtract final : public ToolBase
{
@ -156,7 +157,7 @@ public:
}
#if _WIN32
HECL::Printf(_S("\nContinue? (Y/N) "));
HECL::Printf(_S("\nContinue? (Y/n) "));
#else
if (XTERM_COLOR)
HECL::Printf(_S("\n" BLUE BOLD "Continue?" NORMAL " (Y/N) "));
@ -165,13 +166,14 @@ public:
#endif
int ch;
while ((ch = getchar()))
while ((ch = getch()))
{
if (ch == 'n' || ch == 'N')
return 0;
if (ch == 'y' || ch == 'Y')
if (ch == 'y' || ch == 'Y' || ch == 13)
break;
}
HECL::Printf(_S("\n"));
for (SpecExtractPass& ds : m_specPasses)
{