mirror of https://github.com/AxioDL/metaforce.git
Add '-y' flag for hecl
This commit is contained in:
parent
51d4caf252
commit
d35408376c
|
@ -26,6 +26,7 @@ struct ToolPassInfo
|
|||
hecl::Database::Project* project = nullptr;
|
||||
unsigned verbosityLevel = 0;
|
||||
bool force = false;
|
||||
bool yes = false;
|
||||
};
|
||||
|
||||
class ToolBase
|
||||
|
|
|
@ -121,7 +121,7 @@ public:
|
|||
hecl::Printf(_S("" BOLD "%s" NORMAL ""), rep.name.c_str());
|
||||
else
|
||||
hecl::Printf(_S("%s"), rep.name.c_str());
|
||||
|
||||
|
||||
if (rep.desc.size())
|
||||
hecl::Printf(_S(" [%s]"), rep.desc.c_str());
|
||||
hecl::Printf(_S("\n"));
|
||||
|
@ -151,31 +151,34 @@ public:
|
|||
hecl::Printf(_S("\n"));
|
||||
}
|
||||
|
||||
if (XTERM_COLOR)
|
||||
hecl::Printf(_S("\n" BLUE BOLD "Continue?" NORMAL " (Y/n) "));
|
||||
else
|
||||
hecl::Printf(_S("\nContinue? (Y/n) "));
|
||||
|
||||
int ch;
|
||||
#ifndef _WIN32
|
||||
struct termios tioOld, tioNew;
|
||||
tcgetattr(0, &tioOld);
|
||||
tioNew = tioOld;
|
||||
tioNew.c_lflag &= ~ICANON;
|
||||
tcsetattr(0, TCSANOW, &tioNew);
|
||||
while ((ch = getchar()))
|
||||
#else
|
||||
while ((ch = getch()))
|
||||
#endif
|
||||
if (!m_info.yes)
|
||||
{
|
||||
if (ch == 'n' || ch == 'N')
|
||||
return 0;
|
||||
if (ch == 'y' || ch == 'Y' || ch == '\r' || ch == '\n')
|
||||
break;
|
||||
}
|
||||
if (XTERM_COLOR)
|
||||
hecl::Printf(_S("\n" BLUE BOLD "Continue?" NORMAL " (Y/n) "));
|
||||
else
|
||||
hecl::Printf(_S("\nContinue? (Y/n) "));
|
||||
|
||||
int ch;
|
||||
#ifndef _WIN32
|
||||
tcsetattr(0, TCSANOW, &tioOld);
|
||||
struct termios tioOld, tioNew;
|
||||
tcgetattr(0, &tioOld);
|
||||
tioNew = tioOld;
|
||||
tioNew.c_lflag &= ~ICANON;
|
||||
tcsetattr(0, TCSANOW, &tioNew);
|
||||
while ((ch = getchar()))
|
||||
#else
|
||||
while ((ch = getch()))
|
||||
#endif
|
||||
{
|
||||
if (ch == 'n' || ch == 'N')
|
||||
return 0;
|
||||
if (ch == 'y' || ch == 'Y' || ch == '\r' || ch == '\n')
|
||||
break;
|
||||
}
|
||||
#ifndef _WIN32
|
||||
tcsetattr(0, TCSANOW, &tioOld);
|
||||
#endif
|
||||
}
|
||||
|
||||
hecl::Printf(_S("\n"));
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ int main(int argc, const char** argv)
|
|||
#else
|
||||
std::setlocale(LC_ALL, "en-US.UTF-8");
|
||||
#endif
|
||||
|
||||
|
||||
/* Xterm check */
|
||||
#if _WIN32
|
||||
const char* conemuANSI = getenv("ConEmuANSI");
|
||||
|
@ -201,6 +201,8 @@ int main(int argc, const char** argv)
|
|||
++info.verbosityLevel;
|
||||
else if (*chit == _S('f'))
|
||||
info.force = true;
|
||||
else if (*chit == _S('y'))
|
||||
info.yes = true;
|
||||
else
|
||||
info.flags.push_back(*chit);
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 1eb46301c0e56cf33df173396029841c960e42fd
|
||||
Subproject commit ca38805776c814034af28f68144de64868601da1
|
Loading…
Reference in New Issue