Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
cdo
Commits
cfd743e4
Commit
cfd743e4
authored
Jun 05, 2017
by
Uwe Schulzweida
Browse files
find_similar: Checking for similar operators.
parent
ee5a241b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/modules.cc
View file @
cfd743e4
...
...
@@ -664,7 +664,7 @@ static
std
::
string
find_similar
(
std
::
string
operatorName
)
{
std
::
string
found_similar_operators
=
""
;
unsigned
long
lines
=
1
;
unsigned
long
line_length
=
7
5
;
unsigned
long
line_length
=
10
5
;
if
(
operatorName
!=
""
)
{
// Searching for simlar operator names in operator to module map
for
(
auto
str
:
modules_map
)
{
...
...
@@ -720,20 +720,19 @@ bool check_operator(std::string operatorName) {
fclose
(
fp
);
fprintf
(
stderr
,
"Use commandline option -h for help."
);
Error
(
"Operator missing, %s is a file on disk!"
,
operatorName
.
c_str
());
// Operator is no filename
// Checking for similar operators
fprintf
(
stderr
,
"Operator >%s< not found!
\n
"
,
operatorName
.
c_str
());
fprintf
(
stderr
,
"Similar operators are:
\n
"
);
std
::
string
found_similar_operators
=
find_similar
(
operatorName
);
if
(
found_similar_operators
.
size
()
>
0
)
{
std
::
cerr
<<
found_similar_operators
<<
std
::
endl
;
}
else
{
fprintf
(
stderr
,
"(not found)
\n
"
);
}
exit
(
EXIT_FAILURE
);
}
// Operator is no filename
// Checking for similar operators
fprintf
(
stderr
,
"Operator >%s< not found!
\n
"
,
operatorName
.
c_str
());
fprintf
(
stderr
,
"Similar operators are:
\n
"
);
std
::
string
found_similar_operators
=
find_similar
(
operatorName
);
if
(
found_similar_operators
.
size
()
>
0
)
{
std
::
cerr
<<
found_similar_operators
<<
std
::
endl
;
}
else
{
fprintf
(
stderr
,
"(not found)
\n
"
);
}
exit
(
EXIT_FAILURE
);
}
return
false
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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