dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #16952
Re: parsing parameters
On Tue, Dec 8, 2009 at 6:45 PM, Anders Logg <logg@xxxxxxxxx> wrote:
> 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. :-)
>
Yes it really did turn out to be fubar =D
Thanks for the fix Johan. I don't have gmp installed but doubles are
fine for me.
-- Andy
> --
> Anders
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkse8yIACgkQTuwUCDsYZdFG6wCgjuPaU5wYKxlGGsL/6mE4uZYk
> NfUAnitNlnMJ//q/dyKe2wgKMWtHpade
> =7CO/
> -----END PGP SIGNATURE-----
>
>
References