demo/arg_parser_demo.cc
changeset 88 18444049848b
parent 85 3453d20a82cd
child 128 7cd965d2257f
     1.1 --- a/demo/arg_parser_demo.cc	Thu Jan 24 17:25:31 2008 +0000
     1.2 +++ b/demo/arg_parser_demo.cc	Sun Mar 16 01:39:19 2008 +0100
     1.3 @@ -20,9 +20,9 @@
     1.4  ///\file
     1.5  ///\brief Argument parser demo
     1.6  ///
     1.7 -/// This example shows how can the argument parser used.
     1.8 +/// This example shows how the argument parser can be used.
     1.9  ///
    1.10 -/// \include arg_parser.cc
    1.11 +/// \include arg_parser_demo.cc
    1.12  
    1.13  #include <lemon/arg_parser.h>
    1.14  
    1.15 @@ -35,21 +35,21 @@
    1.16    double d;
    1.17    bool b,sil;
    1.18    bool g1,g2,g3;
    1.19 -  ap.refOption("n", "an integer input", i, true)
    1.20 -    .refOption("val", "a double input", d)
    1.21 +  ap.refOption("n", "An integer input.", i, true)
    1.22 +    .refOption("val", "A double input.", d)
    1.23      .synonym("vals","val")
    1.24 -    .refOption("name", "a string input", s)
    1.25 -    .refOption("f", "a switch", b)
    1.26 +    .refOption("name", "A string input.", s)
    1.27 +    .refOption("f", "A switch.", b)
    1.28      .refOption("nohelp", "", sil)
    1.29 -    .refOption("gra","Choise A",g1)
    1.30 -    .refOption("grb","Choise B",g2)
    1.31 -    .refOption("grc","Choise C",g3)
    1.32 +    .refOption("gra","Choice A",g1)
    1.33 +    .refOption("grb","Choice B",g2)
    1.34 +    .refOption("grc","Choice C",g3)
    1.35      .optionGroup("gr","gra")
    1.36      .optionGroup("gr","grb")
    1.37      .optionGroup("gr","grc")
    1.38      .mandatoryGroup("gr")
    1.39      .onlyOneGroup("gr")
    1.40 -    .other("infile","The input file")
    1.41 +    .other("infile","The input file.")
    1.42      .other("...");
    1.43    
    1.44    ap.parse();
    1.45 @@ -61,7 +61,10 @@
    1.46    if(ap.given("name")) std::cout << "  Value of -name: " << s << std::endl;
    1.47    if(ap.given("f")) std::cout << "  -f is given\n";
    1.48    if(ap.given("nohelp")) std::cout << "  Value of -nohelp: " << sil << std::endl;
    1.49 -
    1.50 +  if(ap.given("gra")) std::cout << "  -gra is given\n";
    1.51 +  if(ap.given("grb")) std::cout << "  -grb is given\n";
    1.52 +  if(ap.given("grc")) std::cout << "  -grc is given\n";
    1.53 +                                     
    1.54    switch(ap.files().size()) {
    1.55    case 0:
    1.56      std::cout << "  No file argument was given.\n";