From e78394a54828ac0fecb36f0438e6829556c88914 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 13 Jan 2014 09:30:52 +0000 Subject: [PATCH] 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. --- messages.mc | Bin 142790 -> 143334 bytes service.cpp | 10 ++++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/messages.mc b/messages.mc index d8f6f0eb137dc352a4404adb2b99b3f1af0a79ea..faa05ad821b1f126aa57d44d49fcc2b60f1520e6 100644 GIT binary patch delta 88 zcmX?ho8#Gijtv^2lLHC_Sc4ft8Js4YhIUV8D-vQ(WKfu_$SOIxNndBOO_&^tSkMfk X$#=q}P{f|8B{XY?RxH delta 18 acmaEMpX1nVjtv^2%^u;~J;E91-2ebrGzgOb 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(); -- 2.20.1