private static ScriptAndArgs processAndReturnArguments(CommandLine commandLine) { ScriptAndArgs info = new ScriptAndArgs(); if (Environment.isSystemSet()) { info.env = Environment.getCurrent().getName(); } else if (commandLine.getEnvironment() != null) { info.env = commandLine.getEnvironment(); } info.inputName = commandLine.getCommandName(); info.name = GrailsNameUtils.getNameFromScript(commandLine.getCommandName()); return info; }