Program_option: problems parsing multiple commands with multiple arguments

Hello, this is my first post in Boost. If this post is not in the right mailing list please let me know, many thanks. I have problems using the "program_options" library while parsing a command line with multiple commands with multiple arguments each. The test.cpp is in attachment. I would like to pars such a command: ./test --firstCommand=arg1 arg2 arg3 --secondCommand=arg1 arg2 arg3 and having as result: ************************ First command detected List of parameters passed: arg1, arg2, arg3 Second command detected List of parameters passed: arg1, arg2, arg3 ************************ But the first command bring the second command as part of its list of arguments with the result: *********************** First command detected List of parameters passed: arg1, arg2, arg3, --secondCommand=arg1, arg2, arg3, ********************** Any hints would be appreciate. Regards, Luca

Luca Luisa wrote:
Hello, this is my first post in Boost. If this post is not in the right mailing list please let me know, many thanks.
I have problems using the "program_options" library while parsing a command line with multiple commands with multiple arguments each. The test.cpp is in attachment.
I would like to pars such a command:
./test --firstCommand=arg1 arg2 arg3 --secondCommand=arg1 arg2 arg3
and having as result: ************************ First command detected List of parameters passed: arg1, arg2, arg3
Second command detected List of parameters passed: arg1, arg2, arg3 ************************
But the first command bring the second command as part of its list of arguments with the result: *********************** First command detected List of parameters passed: arg1, arg2, arg3, --secondCommand=arg1, arg2, arg3, **********************
Any hints would be appreciate.
Is this problem present in 1.42? I believe at least one bugs with similar symptoms was fixed there? - Volodya

Vladimir Prus wrote:
Luca Luisa wrote:
Hello, this is my first post in Boost. If this post is not in the right mailing list please let me know, many thanks.
I have problems using the "program_options" library while parsing a command line with multiple commands with multiple arguments each. The test.cpp is in attachment.
I would like to pars such a command:
./test --firstCommand=arg1 arg2 arg3 --secondCommand=arg1 arg2 arg3
and having as result: ************************ First command detected List of parameters passed: arg1, arg2, arg3
Second command detected List of parameters passed: arg1, arg2, arg3 ************************
But the first command bring the second command as part of its list of arguments with the result: *********************** First command detected List of parameters passed: arg1, arg2, arg3, --secondCommand=arg1, arg2, arg3, **********************
Any hints would be appreciate.
Is this problem present in 1.42? I believe at least one bugs with similar symptoms was fixed there?
- Volodya
I have the version 1.38.1 in Ubuntu.

Luca Luisa wrote:
Vladimir Prus wrote:
Luca Luisa wrote:
Hello, this is my first post in Boost. If this post is not in the right mailing list please let me know, many thanks.
I have problems using the "program_options" library while parsing a command line with multiple commands with multiple arguments each. The test.cpp is in attachment.
I would like to pars such a command:
./test --firstCommand=arg1 arg2 arg3 --secondCommand=arg1 arg2 arg3
and having as result: ************************ First command detected List of parameters passed: arg1, arg2, arg3
Second command detected List of parameters passed: arg1, arg2, arg3 ************************
But the first command bring the second command as part of its list of arguments with the result: *********************** First command detected List of parameters passed: arg1, arg2, arg3, --secondCommand=arg1, arg2, arg3, **********************
Any hints would be appreciate.
Is this problem present in 1.42? I believe at least one bugs with similar symptoms was fixed there?
- Volodya
I have the version 1.38.1 in Ubuntu.
I'm afraid you get to build SVN HEAD or 1.42, then. With SVN HEAD, your testcase produces this output: ***List of commands detected: Command[0]: firstCommand Command[1]: secondCommand First command detected List of parameters passed: arg1, arg2, arg3, Second command detected List of parameters passed: arg1, arg2, arg3, - Volodya
participants (3)
-
Luca Luisa
-
Vladimir Prus
-
Vladimir Prus