Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
613499c3
Commit
613499c3
authored
May 13, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix "bugfix" for option parser with single option
Relates #295
parent
4a5e68b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
libcaf_core/src/message.cpp
libcaf_core/src/message.cpp
+6
-7
No files found.
libcaf_core/src/message.cpp
View file @
613499c3
...
...
@@ -260,14 +260,13 @@ message::cli_res message::extract_opts(std::vector<cli_arg> xs,
}
auto
i
=
shorts
.
find
(
arg1
.
substr
(
0
,
2
));
if
(
i
!=
shorts
.
end
())
{
if
(
i
->
second
->
fun
)
{
if
(
arg1
.
size
()
>
2
)
{
// this short opt comes with a value (no space), e.g., -x2, so we
// have to parse it with the one-argument form above
return
skip_message
();
}
CAF_ASSERT
(
arg1
.
size
()
==
2
);
if
(
!
i
->
second
->
fun
||
arg1
.
size
()
>
2
)
{
// this short opt either expects no argument or comes with a value
// (no space), e.g., -x2, so we have to parse it with the
// one-argument form above
return
skip_message
();
}
CAF_ASSERT
(
arg1
.
size
()
==
2
);
if
(
!
i
->
second
->
fun
(
arg2
))
{
error
=
"invalid value for option "
+
i
->
second
->
name
+
": "
+
arg2
;
return
none
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment