Boost logo

Boost Users :

From: Igor Mikushkin (igor.mikushkin_at_[hidden])
Date: 2008-01-25 04:34:07


Also I don't understand how to restrict hidden values.

For example I want command "myutil --help restrict this" to throw
exeption but it doesn't do it now.

The code I have:

    po :: options_description optionsDescription ("Allowed options");
    optionsDescription.add_options ()
        ("help,h",
                "produce help message.")
        ("something-else",
            po :: value <std :: string> (),
                "something else.");

    po :: variables_map options;

    try {
        po :: store (po :: parse_command_line (argc, argv,
optionsDescription), options);
    }
    catch (po :: unknown_option x)
    {
        std :: cout << x.what () << std :: endl;
        return return_user_fault;
    }

    po :: notify (options);

    if (options.count ("help")) {
        std :: cout << optionsDescription << std :: endl;
        return ioc_util_return_success;
    }


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net