Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
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
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
Libraries
UERANSIM
Commits
b575011d
Commit
b575011d
authored
Feb 13, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Options parser improvement
parent
6fa5b4f3
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
61 deletions
+122
-61
src/utils/options.cpp
src/utils/options.cpp
+114
-52
src/utils/options.hpp
src/utils/options.hpp
+8
-9
No files found.
src/utils/options.cpp
View file @
b575011d
This diff is collapsed.
Click to expand it.
src/utils/options.hpp
View file @
b575011d
...
...
@@ -83,8 +83,8 @@ struct OptionsDescription
class
IOptionsHandler
{
virtual
std
::
istream
istream
()
=
0
;
virtual
std
::
ostream
ostream
(
)
=
0
;
public:
virtual
std
::
ostream
&
ostream
(
bool
isError
)
=
0
;
virtual
void
status
(
int
code
)
=
0
;
};
...
...
@@ -93,13 +93,12 @@ class OptionsResult
private:
std
::
vector
<
std
::
string
>
m_positionalParams
{};
std
::
unordered_map
<
std
::
string
,
std
::
string
>
m_options
{};
std
::
unique_ptr
<
IOptionsHandler
>
m_handler
;
IOptionsHandler
*
m_handler
;
OptionsDescription
m_description
;
public:
OptionsResult
(
int
argc
,
char
**
argv
,
const
OptionsDescription
&
desc
,
bool
freeArgv
=
false
,
std
::
unique_ptr
<
IOptionsHandler
>
handler
=
nullptr
);
OptionsResult
(
const
std
::
vector
<
std
::
string
>
&
args
,
const
OptionsDescription
&
desc
);
OptionsResult
(
int
argc
,
char
**
argv
,
const
OptionsDescription
&
desc
,
bool
freeArgv
,
IOptionsHandler
*
handler
);
OptionsResult
(
const
std
::
vector
<
std
::
string
>
&
args
,
const
OptionsDescription
&
desc
,
IOptionsHandler
*
handler
);
public:
bool
hasFlag
(
const
OptionItem
&
item
)
const
;
...
...
@@ -109,9 +108,9 @@ class OptionsResult
std
::
string
getOption
(
const
OptionItem
&
item
)
const
;
public:
[[
noreturn
]]
void
h
elp
()
const
;
[[
noreturn
]]
void
v
ersion
()
const
;
[[
noreturn
]]
void
e
rror
(
const
std
::
string
&
msg
)
const
;
void
showH
elp
()
const
;
void
showV
ersion
()
const
;
void
showE
rror
(
const
std
::
string
&
msg
)
const
;
};
enum
class
ExpansionResult
...
...
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