/*******************************************************************************
 * (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Apache License v2.0 which accompany this distribution.
 *
 * The Apache License is available at
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 *******************************************************************************/
package org.openscore.lang.tools.verifier;

import org.apache.commons.lang.Validate;
import org.openscore.lang.tools.verifier.configuration.VerifierSpringConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.io.File;

/*
 * Created by stoneo on 1/11/2015.
 */
public class VerifierMain {

    public static void main(String[] args) {
        String repositoryPath = args[0];
        //tODO: add tests for validity including os path separators ...
        Validate.notNull(repositoryPath, "You must pass a path to your repository");
        Validate.isTrue(new File(repositoryPath).isDirectory(), "Directory path argument \'" + repositoryPath + "\' does not lead to a directory");

        ApplicationContext context = new AnnotationConfigApplicationContext(VerifierSpringConfiguration.class);
        SlangContentVerifier slangContentVerifier = context.getBean(SlangContentVerifier.class);
        try {
            slangContentVerifier.verifyAllSlangFilesInDirAreValid(repositoryPath);
            System.out.println("SUCCESS: All slang files under directory: \"" + repositoryPath + "\" are valid.");
            System.exit(0);
        } catch (Exception e) {
            System.out.println(e.getMessage() + "\n\nFAILURE: Validation of slang files under directory: \"" + repositoryPath + "\" failed.");
            System.exit(1);
        }
    }

}

@@ -1890,24 +1890,94 @@
  failed.%22);%0A
+            // TODO - do we want to through exception or exit with 1?%0A
             

Add TODO Signed-off-by: Orit Stone <orit.stone@hp.com>