From 1623ad3a10a5e9ca8bedf5f91fb3c8256e24a665 Mon Sep 17 00:00:00 2001 From: issacto Date: Sun, 25 Jun 2023 22:08:37 +0800 Subject: [PATCH] add check option --- .../cobolcheck/features/argumentHandler/ArgumentHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/openmainframeproject/cobolcheck/features/argumentHandler/ArgumentHandler.java b/src/main/java/org/openmainframeproject/cobolcheck/features/argumentHandler/ArgumentHandler.java index 5ab4ca59..e8526378 100644 --- a/src/main/java/org/openmainframeproject/cobolcheck/features/argumentHandler/ArgumentHandler.java +++ b/src/main/java/org/openmainframeproject/cobolcheck/features/argumentHandler/ArgumentHandler.java @@ -142,6 +142,10 @@ private void processCommandLineArgumentArray(String[] args) { public void loadArgProgramPaths(){ String applicationSourceDirectory = Config.getApplicationSourceDirectoryPathString(); + if(options.isEmpty()){ + // return error when no program is passed + throw new PossibleInternalLogicErrorException(Messages.get("ERR005")); + } for (OptionKey optionKey : options.keySet()) { if (optionKey.shortKey.equals(Constants.PROGRAMS_OPTION) || optionKey.longKey.equals(Constants.PROGRAMS_OPTION)) { String programArgs = options.get(optionKey).argumentValue;