Added translation using Weblate (Italian)
[cygwin-setup.git] / inilintmain.cc
blob886c152f04d98c88c41d1c17500b9573e616dfc0
1 /*
2 * Copyright (c) 2002, Robert Collins.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
12 * Written by Robert Collins <rbtcollins@hotmail.com>
16 #include "io_stream.h"
17 #include "IniDBBuilderLint.h"
18 #include "CliParseFeedback.h"
19 #include "ini.h"
20 #include <iostream>
21 #include <sstream>
22 #include "LogSingleton.h"
24 void
25 show_help()
27 std::cout << "inilint checks cygwin setup.ini files and reports any errors" << std::endl;
30 int
31 main (int argc, char **argv)
33 if (argc != 2)
35 show_help();
36 return 1;
39 std::string inifilename = argv[1];
41 // Note: this only accepts absolute pathnames
42 io_stream *ini_file = io_stream::open ("file://" + inifilename, "rb", 0);
43 if (!ini_file)
45 std::cerr << "could not open " << inifilename << std::endl;
46 return 1;
49 CliParseFeedback feedback;
50 IniDBBuilderLint builder;
51 ini_init(ini_file, &builder, feedback);
53 // Note: unrecognized lines are ignored by ignore_line(), so this is currently
54 // only useful for finding where recognized lines don't fit the grammar.
55 yyparse();
57 return 0;
60 const std::string &
61 get_root_dir ()
63 static std::string empty;
64 return empty;