Thanks for your replay,Steven.
But, even I quote the arguments , the result is not what i want at all.
For example , the argument:
--words "Hi, how are you?"
is parsed to be:
"Hi,
and the words- how are you?"- are ingored.

I attached my code in the first email, is there any mistake in the code?



--- 09年9月12日,周六, Steven Watanabe <watanabesj@gmail.com> 写道:

发件人: Steven Watanabe <watanabesj@gmail.com>
主题: Re: [Boost-users] [program_options]If a parameter in the command line contains white space, how to parse it ?
收件人: boost-users@lists.boost.org
日期: 2009年9月12日,周六,上午7:33

AMDG

yaoyansi wrote:
> i use boost::program_options to parse cmd line parameters.
>
> Attachment has my code.
>
> And here is my test:
>  tst.exe --wav c:/Program Files/Microsoft/a.wav --words "Hi, how are you?" --d "so,\ may\ be."
>
>  the output is :
> wav:[c:/Program  ]
> words:["Hi, ]
> d:["so,\  ]
> --------------------------------------------------
> But, I want the result to be :
> wav:[c:/Program Files/Microsoft/a.wav  ]
>
> words:[Hi, how are you?]
>
> d:[so, may be.  ]
>
> What should I do now?
>   

You should quote arguments containing a space.
I notice that you've already quoted some of the
other arguments.

In Christ,
Steven Watanabe

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users


好玩贺卡等你发,邮箱贺卡全新上线!