Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
R3
legacy
bedtools2
Commits
45321a47
Commit
45321a47
authored
Jun 03, 2015
by
Neil Kindlon
Browse files
Did #147: don't print usage on errors.
parent
bb139717
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/bedtools.cpp
View file @
45321a47
...
...
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
if
(
btDriver
.
supports
(
subCmd
))
{
if
(
btDriver
.
subMain
(
argc
,
argv
))
{
return
0
;
}
else
{
}
else
if
(
!
btDriver
.
hadError
())
{
showHelp
(
subCmd
);
return
1
;
}
...
...
src/utils/Contexts/ContextBase.h
View file @
45321a47
...
...
@@ -70,6 +70,7 @@ public:
ContextFileType
getOutputFileType
()
const
{
return
_outputFileType
;
}
virtual
bool
testCmdArgs
(
int
argc
,
char
**
argv
);
virtual
bool
errorEncountered
()
const
{
return
!
_errorMsg
.
empty
();
}
//isValidState checks that parameters to context are in an acceptable state.
// If not, the error msg string will be set with a reason why it failed.
...
...
src/utils/aux/BedtoolsDriver.cpp
View file @
45321a47
...
...
@@ -24,7 +24,8 @@
#include "fisher.h"
#include "coverageFile.h"
BedtoolsDriver
::
BedtoolsDriver
()
{
BedtoolsDriver
::
BedtoolsDriver
()
:
_hadError
(
false
)
{
_supported
.
insert
(
"intersect"
);
_supported
.
insert
(
"map"
);
_supported
.
insert
(
"closest"
);
...
...
@@ -50,6 +51,7 @@ bool BedtoolsDriver::subMain(int argc, char **argv) {
//process all command line arguments, check for valid usage,
//show help and error messages if needed.
if
(
!
context
->
testCmdArgs
(
argc
-
1
,
argv
+
1
))
{
_hadError
=
context
->
errorEncountered
();
delete
context
;
return
false
;
}
...
...
src/utils/aux/BedtoolsDriver.h
View file @
45321a47
...
...
@@ -8,9 +8,11 @@ public:
bool
supports
(
const
QuickString
&
tool
);
ContextBase
*
getContext
();
ToolBase
*
getTool
(
ContextBase
*
context
);
bool
hadError
()
const
{
return
_hadError
;
}
protected:
QuickString
_subCmd
;
typedef
set
<
QuickString
>
supportType
;
supportType
_supported
;
bool
_hadError
;
};
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