Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plumed AlphaFold
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Kurečka
Plumed AlphaFold
Commits
37d9cab5
There was an error fetching the commit references. Please try again later.
Commit
37d9cab5
authored
11 years ago
by
Gareth Tribello
Browse files
Options
Downloads
Patches
Plain Diff
Made it so help message is output for bad input to simplemd. closes #40
parent
2ff611f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/CLTool.cpp
+12
-3
12 additions, 3 deletions
src/core/CLTool.cpp
with
12 additions
and
3 deletions
src/core/CLTool.cpp
+
12
−
3
View file @
37d9cab5
...
@@ -38,7 +38,7 @@ keys(k)
...
@@ -38,7 +38,7 @@ keys(k)
}
}
void
CLTool
::
registerKeywords
(
Keywords
&
keys
){
void
CLTool
::
registerKeywords
(
Keywords
&
keys
){
keys
.
addFlag
(
"--help"
,
false
,
"print this help"
);
keys
.
addFlag
(
"--help
/-h
"
,
false
,
"print this help"
);
}
}
CLTool
::
CLTool
(
const
CLToolOptions
&
co
)
:
CLTool
::
CLTool
(
const
CLToolOptions
&
co
)
:
...
@@ -106,6 +106,9 @@ bool CLTool::readCommandLineArgs( int argc, char**argv, FILE*out ){
...
@@ -106,6 +106,9 @@ bool CLTool::readCommandLineArgs( int argc, char**argv, FILE*out ){
}
}
if
(
!
found
){
if
(
!
found
){
fprintf
(
stderr
,
"ERROR in input for command line tool %s : %s option is unknown
\n\n
"
,
name
.
c_str
(),
a
.
c_str
()
);
fprintf
(
stderr
,
"ERROR in input for command line tool %s : %s option is unknown
\n\n
"
,
name
.
c_str
(),
a
.
c_str
()
);
fprintf
(
out
,
"Usage: %s < inputFile
\n
"
,
name
.
c_str
()
);
fprintf
(
out
,
"inputFile should contain one directive per line. The directives should come from amongst the following
\n\n
"
);
keywords
.
print
(
out
);
printhelp
=
true
;
printhelp
=
true
;
}
}
}
}
...
@@ -160,7 +163,10 @@ bool CLTool::readInputFile( int argc, char**argv, FILE* in, FILE*out ){
...
@@ -160,7 +163,10 @@ bool CLTool::readInputFile( int argc, char**argv, FILE* in, FILE*out ){
if
(
argc
==
2
){
if
(
argc
==
2
){
mystdin
=
fopen
(
argv
[
1
],
"r"
);
mystdin
=
fopen
(
argv
[
1
],
"r"
);
if
(
!
mystdin
){
if
(
!
mystdin
){
fprintf
(
stderr
,
"ERROR: cannot open file %s
\n
"
,
argv
[
1
]);
fprintf
(
stderr
,
"ERROR: cannot open file %s
\n\n
"
,
argv
[
1
]);
fprintf
(
out
,
"Usage: %s < inputFile
\n
"
,
name
.
c_str
()
);
fprintf
(
out
,
"inputFile should contain one directive per line. The directives should come from amongst the following
\n\n
"
);
keywords
.
print
(
out
);
return
false
;
return
false
;
}
}
}
}
...
@@ -183,7 +189,10 @@ bool CLTool::readInputFile( int argc, char**argv, FILE* in, FILE*out ){
...
@@ -183,7 +189,10 @@ bool CLTool::readInputFile( int argc, char**argv, FILE* in, FILE*out ){
}
}
}
}
if
(
!
found
){
if
(
!
found
){
fprintf
(
stderr
,
"ERROR in input for command line tool %s : unknown keyword %s found in input file
\n
"
,
name
.
c_str
(),
keyword
.
c_str
());
fprintf
(
stderr
,
"ERROR in input for command line tool %s : unknown keyword %s found in input file
\n\n
"
,
name
.
c_str
(),
keyword
.
c_str
());
fprintf
(
out
,
"Usage: %s < inputFile
\n
"
,
name
.
c_str
()
);
fprintf
(
out
,
"inputFile should contain one directive per line. The directives should come from amongst the following
\n\n
"
);
keywords
.
print
(
out
);
if
(
mystdin
)
fclose
(
mystdin
);
if
(
mystdin
)
fclose
(
mystdin
);
return
false
;
return
false
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment