mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 23:07:42 +00:00
Add '-y' flag for hecl
This commit is contained in:
@@ -26,6 +26,7 @@ struct ToolPassInfo
|
||||
hecl::Database::Project* project = nullptr;
|
||||
unsigned verbosityLevel = 0;
|
||||
bool force = false;
|
||||
bool yes = false;
|
||||
};
|
||||
|
||||
class ToolBase
|
||||
|
||||
@@ -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"));
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
2
hecl/extern/boo
vendored
2
hecl/extern/boo
vendored
Submodule hecl/extern/boo updated: 1eb46301c0...ca38805776
Reference in New Issue
Block a user