demo/arg_parser_demo.cc
changeset 2402 da8eb8f4ea41
parent 2391 14a343be7a5a
child 2411 5820c6cec654
equal deleted inserted replaced
1:3a65216ae618 2:5148cd9b6195
    25   int i;
    25   int i;
    26   std::string s;
    26   std::string s;
    27   double d;
    27   double d;
    28   bool b,sil;
    28   bool b,sil;
    29   bool g1,g2,g3;
    29   bool g1,g2,g3;
    30   ap.option("n", "an integer input", i, true)
    30   ap.refOption("n", "an integer input", i, true)
    31     .option("val", "a double input", d)
    31     .refOption("val", "a double input", d)
    32     .synonym("vals","val")
    32     .synonym("vals","val")
    33     .option("name", "a string input", s)
    33     .refOption("name", "a string input", s)
    34     .option("f", "a switch", b)
    34     .refOption("f", "a switch", b)
    35     .option("nohelp", "", sil)
    35     .refOption("nohelp", "", sil)
    36     .option("gra","Choise A",g1)
    36     .refOption("gra","Choise A",g1)
    37     .option("grb","Choise B",g2)
    37     .refOption("grb","Choise B",g2)
    38     .option("grc","Choise C",g3)
    38     .refOption("grc","Choise C",g3)
    39     .optionGroup("gr","gra")
    39     .optionGroup("gr","gra")
    40     .optionGroup("gr","grb")
    40     .optionGroup("gr","grb")
    41     .optionGroup("gr","grc")
    41     .optionGroup("gr","grc")
    42     .mandatoryGroup("gr")
    42     .mandatoryGroup("gr")
    43     .onlyOneGroup("gr")
    43     .onlyOneGroup("gr")