|
Boost Users : |
Subject: Re: [Boost-users] [program_options]If a parameter in the command line contains white space, how to parse it ?
From: yaoyansi (yaoyansi2_at_[hidden])
Date: 2009-09-12 12:58:00
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_at_[hidden]> åéï¼
å件人: Steven Watanabe <watanabesj_at_[hidden]>
主é¢: Re: [Boost-users] [program_options]If a parameter in the command line contains white space, how to parse it ?
æ¶ä»¶äºº: boost-users_at_[hidden]
æ¥æ: 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_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
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