|
Boost Users : |
Subject: Re: [Boost-users] Program Options - positional arguments?
From: Chard (boost_at_[hidden])
Date: 2010-09-29 16:34:25
>"John Dlugosz" <JDlugosz_at_[hidden]> wrote in message
> >news:0D3BBB469BC5844CA9307C81DBC77EF90D2424DF_at_FL01EXMB01.trad.tradestation.com...
>I see in the documentation the class positional_options_description is
>used to list names for positional options. But nowhere in the
> >documentation does it say how to pass this to the parser!
>Given the code based on the documentation samples,
>
> po::store(po::parse_command_line(argc,argv,opt),vm);
> po::notify(vm);
>
>and
>
> po::positional_options_description pd;
> pd.add("output-file", 2).add("input-file", -1);
>
>where do I tell parse_command_line about pd?
Add a ".positional(pd)" to the parser component.
It appears in the tutorial, here:
http://www.boost.org/doc/libs/1_44_0/doc/html/program_options/tutorial.html
(see the sample in the Option Details.)
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