return 0;\r
}\r
\r
+/* User requested us to print our version. */\r
+static bool is_version(const TCHAR *s) {\r
+ if (! s || ! *s) return false;\r
+ /* /version */\r
+ if (*s == '/') s++;\r
+ else if (*s == '-') {\r
+ /* -v, -V, -version, --version */\r
+ s++;\r
+ if (*s == '-') s++;\r
+ else if (str_equiv(s, _T("v"))) return true;\r
+ }\r
+ if (str_equiv(s, _T("version"))) return true;\r
+ return false;\r
+}\r
+\r
int str_number(const TCHAR *string, unsigned long *number) {\r
TCHAR *bogus;\r
return str_number(string, number, &bogus);\r
/*\r
Valid commands are:\r
start, stop, pause, continue, install, edit, get, set, reset, unset, remove\r
+ status, statuscode, rotate, list, processes, version\r
*/\r
+ if (is_version(argv[1])) {\r
+ _tprintf(_T("%s %s %s %s\n"), NSSM, NSSM_VERSION, NSSM_CONFIGURATION, NSSM_DATE);\r
+ nssm_exit(0);\r
+ }\r
if (str_equiv(argv[1], _T("start"))) nssm_exit(control_service(NSSM_SERVICE_CONTROL_START, argc - 2, argv + 2));\r
if (str_equiv(argv[1], _T("stop"))) nssm_exit(control_service(SERVICE_CONTROL_STOP, argc - 2, argv + 2));\r
if (str_equiv(argv[1], _T("restart"))) {\r