Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
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
Administrator
linphone-desktop
Commits
2ce85954
Commit
2ce85954
authored
Jun 20, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(Cli): coding style & authorized function name
parent
505aadb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
Cli.cpp
src/app/cli/Cli.cpp
+18
-4
No files found.
src/app/cli/Cli.cpp
View file @
2ce85954
...
...
@@ -45,7 +45,12 @@ static void cliCall (const QHash<QString, QString> &args) {
// =============================================================================
Cli
::
Command
::
Command
(
const
QString
&
functionName
,
const
QString
&
description
,
Cli
::
Function
function
,
const
QHash
<
QString
,
Cli
::
Argument
>
&
argsScheme
)
:
Cli
::
Command
::
Command
(
const
QString
&
functionName
,
const
QString
&
description
,
Cli
::
Function
function
,
const
QHash
<
QString
,
Cli
::
Argument
>
&
argsScheme
)
:
mFunctionName
(
functionName
),
mDescription
(
description
),
mFunction
(
function
),
...
...
@@ -68,7 +73,7 @@ void Cli::Command::execute (const QHash<QString, QString> &args) {
// FIXME: Do not accept args without value like: cmd toto.
// In the future `toto` could be a boolean argument.
QRegExp
Cli
::
mRegExpArgs
(
"(?:(?:(
\\
w+)
\\
s*)=
\\
s*(?:
\"
([^
\"\\\\
]*(?:
\\\\
.[^
\"\\\\
]*)*)
\"
|([^
\\
s]+)
\\
s*))"
);
QRegExp
Cli
::
mRegExpFunctionName
(
"^
\\
s*(
\\
w
+)
\\
s*"
);
QRegExp
Cli
::
mRegExpFunctionName
(
"^
\\
s*(
[a-z-]
+)
\\
s*"
);
Cli
::
Cli
(
QObject
*
parent
)
:
QObject
(
parent
)
{
addCommand
(
"show"
,
tr
(
"showFunctionDescription"
),
::
cliShow
);
...
...
@@ -79,7 +84,12 @@ Cli::Cli (QObject *parent) : QObject(parent) {
// -----------------------------------------------------------------------------
void
Cli
::
addCommand
(
const
QString
&
functionName
,
const
QString
&
description
,
Function
function
,
const
QHash
<
QString
,
Argument
>
&
argsScheme
)
noexcept
{
void
Cli
::
addCommand
(
const
QString
&
functionName
,
const
QString
&
description
,
Function
function
,
const
QHash
<
QString
,
Argument
>
&
argsScheme
)
noexcept
{
if
(
mCommands
.
contains
(
functionName
))
qWarning
()
<<
QStringLiteral
(
"Command already exists: `%1`."
).
arg
(
functionName
);
else
...
...
@@ -121,7 +131,11 @@ const QString Cli::parseFunctionName (const QString &command) noexcept {
return
functionName
;
}
const
QHash
<
QString
,
QString
>
Cli
::
parseArgs
(
const
QString
&
command
,
const
QString
functionName
,
bool
&
soFarSoGood
)
noexcept
{
const
QHash
<
QString
,
QString
>
Cli
::
parseArgs
(
const
QString
&
command
,
const
QString
functionName
,
bool
&
soFarSoGood
)
noexcept
{
QHash
<
QString
,
QString
>
args
;
int
pos
=
0
;
...
...
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