Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Command line mode doesn't return exit-code to indicate failure. #151

Closed
bsmith89 opened this Issue Aug 21, 2015 · 9 comments

Comments

Projects
None yet
4 participants

I'm trying to incorporate some mothur commands into a Makefile using the mothur "#some.command()" syntax (http://www.mothur.org/wiki/Command_line_mode).

At least for all of the examples I've tried (e.g. mothur "#not.a.command()"), the exit code is always 0. This leads to problems when the remaining steps in the pipeline execute.

I realize I'm trying to use mothur in a way it was not designed, but I'm hoping it's not a difficult patch. I'd also like a command-line option to turn off the welcome screen, but that's a different issue.

I see this has been discussed before: http://mothur.org/forum/viewtopic.php?f=10&t=2699

Contributor

pschloss commented Aug 22, 2015

Thanks Byron - we've been working on adding a few more command line options in the recent releases. We'll add a flag to remove the welcome screen. Also we'll have mothur rerun a 1 on successful completion and a 0 if there's an error.

We appreciate the suggestions!
Pat

Maybe that was a typo, but just in case: the normal "success" exit code on UNIX is 0, other numbers indicate failure.

Contributor

pschloss commented Aug 24, 2015

I see, you want it to be 1 if there's an error - right?

Yep, exactly. Some people will use different exit codes to mean different
things, but just returning "1" will work perfectly for my needs.

On Mon, Aug 24, 2015 at 2:04 PM, Pat Schloss notifications@github.com
wrote:

I see, you want it to be 1 if there's an error - right?


Reply to this email directly or view it on GitHub
#151 (comment).

Contributor

mothur-westcott commented Aug 24, 2015

If you want to skip the welcome screen you can run mothur in "quiet" mode.

./mothur "#myCommand(...);" -q

Oh, I didn't realize that. Thanks for the tip!

On Mon, Aug 24, 2015 at 2:12 PM, Sarah Westcott notifications@github.com
wrote:

If you want to skip the welcome screen you can run mothur in "quiet" mode.

./mothur "#myCommand(...);" -q


Reply to this email directly or view it on GitHub
#151 (comment).

I know this is an older issue, but I am running into the same problems as @bsmith89

@mooreryan mooreryan referenced this issue in mooreryan/ZetaHunter Apr 12, 2016

Closed

Mothur errors do not kill ZH #10

Contributor

mothur-westcott commented Apr 12, 2016

Thanks for hitting this thread again, :). In version 1.37 we added output to the log file indicating the number of errors and warnings. The 1.38.0 branch includes the return codes you are looking for. If the log file indicates errors the return code will be set to 1, otherwise 0.

@pschloss pschloss added this to the Version 1.38.0 milestone Apr 14, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment