Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Dependencies
Cpp
mirrage
Commits
e074943f
Commit
e074943f
authored
Mar 28, 2019
by
Florian Oetke
Browse files
fixed argument parsing in utils/console_command
parent
fe73cebb
Pipeline
#2854
passed with stage
in 13 minutes and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/mirrage/utils/include/mirrage/utils/console_command.hpp
View file @
e074943f
...
...
@@ -131,15 +131,19 @@ namespace mirrage::util {
if
(
arg_iter
==
arg_end
)
{
LOG
(
plog
::
error
)
<<
"Not enough arguments."
;
return
util
::
nothing
;
}
auto
curr
=
*
arg_iter
;
arg_iter
++
;
}
else
if
((
*
arg_iter
)
[
1
].
length
()
==
0
)
{
if
(
curr
[
1
].
length
()
==
0
)
{
return
util
::
from_string
<
typename
decltype
(
type
)
::
type
>
(
cmd
.
substr
(
std
::
size_t
(
arg_iter
->
position
()),
std
::
size_t
(
arg_iter
->
length
())));
cmd
.
substr
(
std
::
size_t
(
curr
.
position
()),
std
::
size_t
(
curr
.
length
())));
}
else
{
// quoted
auto
arg
=
std
::
string_view
(
(
*
arg_iter
)
[
1
].
first
,
std
::
size_t
(
(
*
arg_iter
)
[
1
].
length
()));
auto
arg
=
std
::
string_view
(
curr
[
1
].
first
,
std
::
size_t
(
curr
[
1
].
length
()));
if
(
!
arg
.
find
(
"
\\
"
))
return
util
::
from_string
<
typename
decltype
(
type
)
::
type
>
(
arg
);
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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