From: Iain Patterson Date: Mon, 13 Jan 2014 09:30:52 +0000 (+0000) Subject: Added error message for missing subparameter. X-Git-Tag: v2.22~63 X-Git-Url: http://git.iain.cx/?p=nssm.git;a=commitdiff_plain;h=e78394a54828ac0fecb36f0438e6829556c88914 Added error message for missing subparameter. Clarify the output when editing a service on the command line and a mandatory subparameter was not supplied. Thanks Chris Blaszczynski. --- diff --git a/messages.mc b/messages.mc index d8f6f0e..faa05ad 100644 Binary files a/messages.mc and b/messages.mc differ diff --git a/service.cpp b/service.cpp index b8c73ef..8074227 100644 --- a/service.cpp +++ b/service.cpp @@ -701,14 +701,20 @@ int pre_edit_service(int argc, TCHAR **argv) { for (i = 0; settings[i].name; i++) _ftprintf(stderr, _T("%s\n"), settings[i].name); return 1; } - if (argc < mandatory) return usage(1); additional = 0; if (additional_mandatory) { + if (argc < mandatory) { + print_message(stderr, NSSM_MESSAGE_MISSING_SUBPARAMETER, parameter); + return 1; + } additional = argv[3]; remainder = 4; } - else additional = argv[remainder]; + else { + additional = argv[remainder]; + if (argc < mandatory) return usage(1); + } } nssm_service_t *service = alloc_nssm_service();