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
8ad0767a
Commit
8ad0767a
authored
Feb 13, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gNB CLI improvements
parent
b7a56d6d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
src/cli.cpp
src/cli.cpp
+8
-2
src/utils/options.cpp
src/utils/options.cpp
+6
-1
src/utils/options.hpp
src/utils/options.hpp
+2
-1
No files found.
src/cli.cpp
View file @
8ad0767a
...
...
@@ -214,9 +214,15 @@ static bool HandleMessage(const app::CliMessage &msg, bool isOneShot)
std
::
cout
<<
"
\x1b
[1m"
;
std
::
cout
<<
std
::
string
(
92
,
'-'
)
<<
std
::
endl
;
std
::
string
line
{};
bool
isEof
{};
std
::
vector
<
std
::
string
>
tokens
{};
if
(
!
opt
::
ReadLine
(
std
::
cin
,
std
::
cout
,
line
,
tokens
))
exit
(
0
);
if
(
!
opt
::
ReadLine
(
std
::
cin
,
std
::
cout
,
line
,
tokens
,
isEof
))
{
if
(
isEof
)
exit
(
0
);
else
std
::
cout
<<
"ERROR: Invalid command"
<<
std
::
endl
;
}
std
::
cout
<<
"
\x1b
[0m"
;
if
(
line
.
empty
())
continue
;
...
...
src/utils/options.cpp
View file @
8ad0767a
...
...
@@ -361,17 +361,22 @@ opt::ExpansionResult opt::PerformExpansion(const std::string &command, std::vect
return
ExpansionResult
::
UNSPECIFIED_ERROR
;
}
bool
opt
::
ReadLine
(
std
::
istream
&
istream
,
std
::
ostream
&
ostream
,
std
::
string
&
line
,
std
::
vector
<
std
::
string
>
&
tokens
)
bool
opt
::
ReadLine
(
std
::
istream
&
istream
,
std
::
ostream
&
ostream
,
std
::
string
&
line
,
std
::
vector
<
std
::
string
>
&
tokens
,
bool
&
isEof
)
{
ostream
<<
"$ "
;
std
::
string
input
{};
isEof
=
false
;
while
(
true
)
{
std
::
string
ln
{};
std
::
getline
(
istream
,
ln
);
if
(
!
istream
)
{
isEof
=
true
;
return
false
;
}
input
+=
ln
;
std
::
vector
<
std
::
string
>
vec
{};
...
...
src/utils/options.hpp
View file @
8ad0767a
...
...
@@ -127,6 +127,7 @@ enum class ExpansionResult
ExpansionResult
PerformExpansion
(
const
std
::
string
&
command
,
std
::
vector
<
std
::
string
>
&
argv
);
bool
ReadLine
(
std
::
istream
&
istream
,
std
::
ostream
&
ostream
,
std
::
string
&
line
,
std
::
vector
<
std
::
string
>
&
tokens
);
bool
ReadLine
(
std
::
istream
&
istream
,
std
::
ostream
&
ostream
,
std
::
string
&
line
,
std
::
vector
<
std
::
string
>
&
tokens
,
bool
&
isEof
);
}
// namespace opt
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