Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mirrage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
GameDevWeek
D
Dependencies
Cpp
mirrage
Commits
e074943f
Commit
e074943f
authored
Mar 28, 2019
by
Florian Oetke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
src/mirrage/utils/include/mirrage/utils/console_command.hpp
src/mirrage/utils/include/mirrage/utils/console_command.hpp
+9
-5
No files found.
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
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