Bug fixes in the documentation (mainly bad references).
3 * This file is a part of LEMON, a generic C++ optimization library
5 * Copyright (C) 2003-2007
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
19 #include <lemon/arg_parser.h>
21 using namespace lemon;
22 int main(int argc, const char **argv)
24 ArgParser ap(argc,argv);
30 ap.refOption("n", "an integer input", i, true)
31 .refOption("val", "a double input", d)
32 .synonym("vals","val")
33 .refOption("name", "a string input", s)
34 .refOption("f", "a switch", b)
35 .refOption("nohelp", "", sil)
36 .refOption("gra","Choise A",g1)
37 .refOption("grb","Choise B",g2)
38 .refOption("grc","Choise C",g3)
39 .optionGroup("gr","gra")
40 .optionGroup("gr","grb")
41 .optionGroup("gr","grc")
44 .other("infile","The input file")
49 std::cout << "Parameters of '" << ap.commandName() << "':\n";
51 if(ap.given("n")) std::cout << " Value of -n: " << i << std::endl;
52 if(ap.given("val")) std::cout << " Value of -val: " << d << std::endl;
53 if(ap.given("name")) std::cout << " Value of -name: " << s << std::endl;
54 if(ap.given("f")) std::cout << " -f is given\n";
55 if(ap.given("nohelp")) std::cout << " Value of -nohelp: " << sil << std::endl;
57 switch(ap.files().size()) {
59 std::cout << " No file argument was given.\n";
62 std::cout << " 1 file argument was given. It is:\n";
66 << ap.files().size() << " file arguments were given. They are:\n";
68 for(unsigned int i=0;i<ap.files().size();++i)
69 std::cout << " '" << ap.files()[i] << "'\n";