fix: Remove --exit-pause to stop "press any key to exit..." showing when Windows daemon kills server/client
This commit is contained in:
@ -129,8 +129,6 @@ int App::run(int argc, char **argv)
|
||||
LOG((CLOG_CRIT "an unknown error occurred\n"));
|
||||
}
|
||||
|
||||
appUtil().beforeAppExit();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -209,16 +209,14 @@ private:
|
||||
#elif SYSAPI_WIN32
|
||||
|
||||
// windows args
|
||||
#define HELP_SYS_ARGS " [--service <action>] [--relaunch] [--exit-pause]"
|
||||
#define HELP_SYS_ARGS " [--service <action>] [--relaunch]"
|
||||
#define HELP_SYS_INFO \
|
||||
" --service <action> manage the windows service, valid options " \
|
||||
"are:\n" \
|
||||
" install/uninstall/start/stop\n" \
|
||||
" --relaunch persistently relaunches process in current " \
|
||||
"user \n" \
|
||||
" session (useful for vista and upward).\n" \
|
||||
" --exit-pause wait for key press on exit, can be useful for\n" \
|
||||
" reading error messages that occur on exit.\n"
|
||||
" session (useful for vista and upward).\n"
|
||||
#endif
|
||||
|
||||
#if !defined(WINAPI_LIBEI) && WINAPI_XWINDOWS
|
||||
|
||||
@ -28,9 +28,6 @@ public:
|
||||
{
|
||||
instance().exitApp(code);
|
||||
}
|
||||
virtual void beforeAppExit()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
IApp *m_app;
|
||||
|
||||
@ -121,9 +121,7 @@ bool ArgParser::parsePlatformArgs(
|
||||
)
|
||||
{
|
||||
#if WINAPI_MSWINDOWS
|
||||
if (isArg(i, argc, argv, nullptr, "--exit-pause")) {
|
||||
argsBase.m_pauseOnExit = true;
|
||||
} else if (isArg(i, argc, argv, nullptr, "--stop-on-desk-switch")) {
|
||||
if (isArg(i, argc, argv, nullptr, "--stop-on-desk-switch")) {
|
||||
argsBase.m_stopOnDeskSwitch = true;
|
||||
} else {
|
||||
// option not supported here
|
||||
|
||||
@ -91,7 +91,6 @@ public:
|
||||
|
||||
#if SYSAPI_WIN32
|
||||
bool m_debugServiceWait = false;
|
||||
bool m_pauseOnExit = false;
|
||||
bool m_stopOnDeskSwitch = false;
|
||||
#endif
|
||||
|
||||
|
||||
@ -19,7 +19,6 @@ public:
|
||||
virtual void adoptApp(IApp *app) = 0;
|
||||
virtual IApp &app() const = 0;
|
||||
virtual int run(int argc, char **argv) = 0;
|
||||
virtual void beforeAppExit() = 0;
|
||||
virtual void startNode() = 0;
|
||||
virtual std::vector<std::string> getKeyboardLayoutList() = 0;
|
||||
virtual std::string getCurrentLanguageCode() = 0;
|
||||
|
||||
@ -99,17 +99,6 @@ static int foregroundStartupStatic(int argc, char **argv)
|
||||
return AppUtil::instance().app().foregroundStartup(argc, argv);
|
||||
}
|
||||
|
||||
void AppUtilWindows::beforeAppExit()
|
||||
{
|
||||
// this can be handy for debugging, since the application is launched in
|
||||
// a new console window, and will normally close on exit (making it so
|
||||
// that we can't see error messages).
|
||||
if (app().argsBase().m_pauseOnExit) {
|
||||
std::cout << std::endl << "press any key to exit..." << std::endl;
|
||||
int c = _getch();
|
||||
}
|
||||
}
|
||||
|
||||
int AppUtilWindows::run(int argc, char **argv)
|
||||
{
|
||||
if (!IsWindowsXPSP3OrGreater()) {
|
||||
|
||||
@ -35,7 +35,6 @@ public:
|
||||
void debugServiceWait();
|
||||
int run(int argc, char **argv) override;
|
||||
void exitApp(int code) override;
|
||||
void beforeAppExit() override;
|
||||
void startNode() override;
|
||||
std::vector<std::string> getKeyboardLayoutList() override;
|
||||
std::string getCurrentLanguageCode() override;
|
||||
|
||||
@ -207,10 +207,7 @@ TEST(ArgParserTests, parseServerArgs_parses_each_category)
|
||||
args.m_daemon = false;
|
||||
char const *argv[] = {
|
||||
"deskflow", "--help"
|
||||
#if WINAPI_MSWINDOWS
|
||||
,
|
||||
"--exit-pause"
|
||||
#elif WINAPI_XWINDOWS
|
||||
#if WINAPI_XWINDOWS
|
||||
,
|
||||
"--no-xinitthreads"
|
||||
#endif
|
||||
@ -229,10 +226,7 @@ TEST(ArgParserTests, parseClientArgs_parses_single_help)
|
||||
char const *argv[] = {
|
||||
kAppId,
|
||||
"--help"
|
||||
#if WINAPI_MSWINDOWS
|
||||
,
|
||||
"--exit-pause"
|
||||
#elif WINAPI_XWINDOWS
|
||||
#if WINAPI_XWINDOWS
|
||||
,
|
||||
"--no-xinitthreads"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user