/*
 * Copyright 2016 SEARCH-The National Consortium for Justice Information and Statistics
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.search.nibrs.report;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.search.nibrs.model.reports.ReturnAForm;
import org.search.nibrs.report.service.ExcelExporter;
import org.search.nibrs.report.service.StagingDataRestClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class NibrsSummaryReportApplication implements CommandLineRunner{
	public static final Log log = LogFactory.getLog(NibrsSummaryReportApplication.class);
	@Autowired 
	public StagingDataRestClient restClient; 
	@Autowired 
	public ExcelExporter excelExporter;
	public static ConfigurableApplicationContext context;
	
	public static void main(String[] args) {
		SpringApplication.run(NibrsSummaryReportApplication.class, args).close();
	}
	
    @Override
    public void run(String... args) throws Exception {

    	if (args.length < 3){
    		log.error("Missing one or more required arguments ORI, Year or Month");
    		System.exit(0);; 
    	}
    	
        for (String arg: args){
        	System.out.println("arg: " + arg);
        }
        
        ReturnAForm returnAForm = restClient.getReturnAForm(args[0], args[1], args[2]);
        System.out.println("returnAForm: \n" + returnAForm);
        excelExporter.exportReturnAForm(returnAForm);

    }
}

@@ -1809,76 +1809,450 @@
   %09%09
-log.error(%22Missing 
+System.out.println(%22Please enter all the n
 on
-e
  o
-r more required arguments ORI, Year or Month
+ptional arguments ORI, Year and Month%22);%0A    %09%09System.out.println(%22Example: java -jar target/nibrs-summary-report-1.0.0.jar HI0020000 2017 3%22);%0A    %09%09System.out.println(%22Additional optional arguments can be entered: %22);%0A    %09%09System.out.println(%22--app.stagingDataRestServiceBaseUrl default value is http://localhost:8080%22);%0A    %09%09System.out.println(%22--app.returnAFormOutputPath default value is .
 %22);%0A

Add help output when not all the required arguments are entered.