← Back to team overview

dolfin team mailing list archive

Re: parsing parameters

 

On Tue, Dec 08, 2009 at 01:17:17PM -0600, Andy Ray Terrel wrote:
> On Tue, Dec 8, 2009 at 1:00 PM, Anders Logg <logg@xxxxxxxxx> wrote:
> > On Tue, Dec 08, 2009 at 12:42:20PM -0600, Andy Ray Terrel wrote:
> >> Am I doing something wrong here or is this a bug?
> >>
> >> dolfin/demo/parameters/cpp$ ./demo --foo 1.0
> >>
> >> results in:
> >>
> >> Parsing command-line arguments...
> >> terminate called after throwing an instance of
> >> 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::program_options::unknown_option>
> >> >'
> >>   what():  unknown option foo
> >>
> >>
> >> this is happens on both my mac and ubuntu boxes.
> >>
> >> -- Andy
> >
> > You're doing it all wrong! It should be "bar", not "foo".
> >
> >
>
> Shouldn't foo work or is there some other way to specify it on the
> command line.  I have this trouble with all reals.  From the demo:
>
>  Parameters application_parameters("application_parameters");
>
>   // Create application parameters
>   application_parameters.add("foo", 1.0);
>   application_parameters.add("bar", 100);
>   application_parameters.add("pc", "amg");
>   // Parse command-line options
>   application_parameters.parse(argc, argv);

Yes, sorry about that. Turns out I had it all wrong. But I thought it
would be pretty cool if foo was wrong and bar was right. :-)

--
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References