Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
436b30c6
Commit
436b30c6
authored
Oct 01, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed option loading mechanism
parent
60099c12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
CmdLineOptParser.cc
src/CmdLineOptParser.cc
+3
-1
CmdLineOptParser.h
src/CmdLineOptParser.h
+1
-1
main.cc
src/main.cc
+4
-3
No files found.
src/CmdLineOptParser.cc
View file @
436b30c6
...
...
@@ -51,7 +51,9 @@ void ParseCmdLineOptions(int& argc, ///< count of ar
if
(
arg
.
startsWith
(
QString
(
"%1:"
).
arg
(
optionStr
),
Qt
::
CaseInsensitive
))
{
found
=
true
;
prgOpts
[
iOption
].
optionArg
=
arg
.
right
(
arg
.
length
()
-
(
optionStr
.
length
()
+
1
));
if
(
prgOpts
[
iOption
].
optionArg
)
{
*
prgOpts
[
iOption
].
optionArg
=
arg
.
right
(
arg
.
length
()
-
(
optionStr
.
length
()
+
1
));
}
}
else
if
(
arg
.
compare
(
optionStr
,
Qt
::
CaseInsensitive
)
==
0
)
{
found
=
true
;
}
...
...
src/CmdLineOptParser.h
View file @
436b30c6
...
...
@@ -36,7 +36,7 @@
typedef
struct
{
const
char
*
optionStr
;
///< command line option, for example "--foo"
bool
*
optionFound
;
///< if option is found this variable will be set to true
QString
optionArg
;
///< Option has additional argument, form is option:arg
QString
*
optionArg
;
///< Option has additional argument, form is option:arg
}
CmdLineOpt_t
;
void
ParseCmdLineOptions
(
int
&
argc
,
...
...
src/main.cc
View file @
436b30c6
...
...
@@ -135,9 +135,10 @@ int main(int argc, char *argv[])
bool
quietWindowsAsserts
=
false
;
// Don't let asserts pop dialog boxes
QString
unitTestOptions
;
CmdLineOpt_t
rgCmdLineOptions
[]
=
{
{
"--unittest"
,
&
runUnitTests
,
QString
()
},
{
"--no-windows-assert-ui"
,
&
quietWindowsAsserts
,
QString
()
},
{
"--unittest"
,
&
runUnitTests
,
&
unitTestOptions
},
{
"--no-windows-assert-ui"
,
&
quietWindowsAsserts
,
NULL
},
// Add additional command line option flags here
};
...
...
@@ -181,7 +182,7 @@ int main(int argc, char *argv[])
}
// Run the test
int
failures
=
UnitTest
::
run
(
rgCmdLineOptions
[
0
].
optionArg
);
int
failures
=
UnitTest
::
run
(
unitTestOptions
);
if
(
failures
==
0
)
{
qDebug
()
<<
"ALL TESTS PASSED"
;
}
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