2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.validation.tool;
11 import java.net.URISyntaxException;
12 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
16 public final class Main {
17 private static final Logger LOG = LoggerFactory.getLogger(Main.class);
23 public static void main(final String[] args) throws URISyntaxException {
24 final Params params = ParamsUtil.parseArgs(args, Params.getParser());
26 if (params.isValid()) {
27 final File[] yangModels = params.getYangSourceDir().listFiles();
30 YangParserTestUtils.parseYangFiles(yangModels);
31 } catch (Exception e) {
32 LOG.error("Yang files could not be parsed.", e);