1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Write out all library debug switches
27 \*---------------------------------------------------------------------------*/
30 #include "dictionary.H"
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 int main(int argc, char *argv[])
42 argList::noParallel();
43 argList::addBoolOption
46 "output switches that are known from the libraries "
47 "but that do not seem to be known in the current etc/controlDict"
49 argList::addBoolOption
52 "output switches that appear to be unknown in "
53 "the current etc/controlDict"
56 argList args(argc, argv);
58 wordList currDebug(debug::debugSwitches().toc());
59 wordList currInfo(debug::infoSwitches().toc());
60 wordList currOpt(debug::optimisationSwitches().toc());
62 if (args.optionFound("old") || args.optionFound("new"))
64 fileNameList controlDictFiles = findEtcFiles("controlDict", true);
65 dictionary controlDict;
66 forAllReverse(controlDictFiles, cdfi)
68 controlDict.merge(dictionary(IFstream(controlDictFiles[cdfi])()));
73 controlDict.subDict("DebugSwitches").toc()
78 controlDict.subDict("InfoSwitches").toc()
83 controlDict.subDict("OptimisationSwitches").toc()
91 // list old switches - but this can't work since the (old) inserted
92 // switches are in both sets
94 // 1. run without any options (get complete list)
95 // 2. comment out DebugSwitches, run again with -new to find new ones
97 if (args.optionFound("old"))
99 IOobject::writeDivider(Info);
102 hashset -= currDebug;
103 listing = hashset.toc();
105 Info<< "old DebugSwitches: " << listing << endl;
109 listing = hashset.toc();
111 Info<< "old InfoSwitches: " << listing << endl;
115 listing = hashset.toc();
117 Info<< "old OptimisationSwitches: " << listing << endl;
121 if (args.optionFound("new"))
123 IOobject::writeDivider(Info);
128 listing = hashset.toc();
130 Info<< "new DebugSwitches: " << listing << endl;
134 listing = hashset.toc();
136 Info<< "new InfoSwitches: " << listing << endl;
140 listing = hashset.toc();
142 Info<< "new OptimisationSwitches: " << listing << endl;
147 IOobject::writeDivider(Info);
150 Info<< "DebugSwitches: " << currDebug << endl;
153 Info<< "InfoSwitches: " << currInfo << endl;
156 Info<< "OptimisationSwitches: " << currOpt << endl;
161 Info<< "done" << endl;
167 // ************************************************************************* //