diff --git a/hecl/driver/ToolBase.hpp b/hecl/driver/ToolBase.hpp index 705acaea6..a80d4555e 100644 --- a/hecl/driver/ToolBase.hpp +++ b/hecl/driver/ToolBase.hpp @@ -26,6 +26,7 @@ struct ToolPassInfo hecl::Database::Project* project = nullptr; unsigned verbosityLevel = 0; bool force = false; + bool yes = false; }; class ToolBase diff --git a/hecl/driver/ToolExtract.hpp b/hecl/driver/ToolExtract.hpp index fc1120c73..b8b92ca11 100644 --- a/hecl/driver/ToolExtract.hpp +++ b/hecl/driver/ToolExtract.hpp @@ -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")); diff --git a/hecl/driver/main.cpp b/hecl/driver/main.cpp index 3a6e6b8aa..2d3e595ab 100644 --- a/hecl/driver/main.cpp +++ b/hecl/driver/main.cpp @@ -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); } diff --git a/hecl/extern/boo b/hecl/extern/boo index 1eb46301c..ca3880577 160000 --- a/hecl/extern/boo +++ b/hecl/extern/boo @@ -1 +1 @@ -Subproject commit 1eb46301c0e56cf33df173396029841c960e42fd +Subproject commit ca38805776c814034af28f68144de64868601da1