COIN-OR::LEMON - Graph Library

Changeset 88:18444049848b in lemon-1.0 for demo/arg_parser_demo.cc


Ignore:
Timestamp:
03/16/08 01:39:19 (17 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Minor improvements in arg_parser files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • demo/arg_parser_demo.cc

    r85 r88  
    2121///\brief Argument parser demo
    2222///
    23 /// This example shows how can the argument parser used.
     23/// This example shows how the argument parser can be used.
    2424///
    25 /// \include arg_parser.cc
     25/// \include arg_parser_demo.cc
    2626
    2727#include <lemon/arg_parser.h>
     
    3636  bool b,sil;
    3737  bool g1,g2,g3;
    38   ap.refOption("n", "an integer input", i, true)
    39     .refOption("val", "a double input", d)
     38  ap.refOption("n", "An integer input.", i, true)
     39    .refOption("val", "A double input.", d)
    4040    .synonym("vals","val")
    41     .refOption("name", "a string input", s)
    42     .refOption("f", "a switch", b)
     41    .refOption("name", "A string input.", s)
     42    .refOption("f", "A switch.", b)
    4343    .refOption("nohelp", "", sil)
    44     .refOption("gra","Choise A",g1)
    45     .refOption("grb","Choise B",g2)
    46     .refOption("grc","Choise C",g3)
     44    .refOption("gra","Choice A",g1)
     45    .refOption("grb","Choice B",g2)
     46    .refOption("grc","Choice C",g3)
    4747    .optionGroup("gr","gra")
    4848    .optionGroup("gr","grb")
     
    5050    .mandatoryGroup("gr")
    5151    .onlyOneGroup("gr")
    52     .other("infile","The input file")
     52    .other("infile","The input file.")
    5353    .other("...");
    5454 
     
    6262  if(ap.given("f")) std::cout << "  -f is given\n";
    6363  if(ap.given("nohelp")) std::cout << "  Value of -nohelp: " << sil << std::endl;
    64 
     64  if(ap.given("gra")) std::cout << "  -gra is given\n";
     65  if(ap.given("grb")) std::cout << "  -grb is given\n";
     66  if(ap.given("grc")) std::cout << "  -grc is given\n";
     67                                     
    6568  switch(ap.files().size()) {
    6669  case 0:
Note: See TracChangeset for help on using the changeset viewer.