[SERVER-1172] Allow non zero return code to be specified by javascript shell Created: 29/May/10 Updated: 12/Jul/16 Resolved: 21/Oct/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | 1.7.2 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | dan | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Currently the mongo shell supports returning a non zero code only when invoked with the name of a script (see http://jira.mongodb.org/browse/SERVER-1148 ) and in that case, support simply a success or failure code. However, I would suggest supporting returning a user-defined non-zero exit code upon exiting (possibly wiht some extention of the "exit" syntax? - see http://jira.mongodb.org/browse/SERVER-683 ) Use cases: This would ease the usage of the JS shell as a system maintenance toolkit which is very useful as long as |
| Comments |
| Comment by Mathias Stearn [ 21/Oct/10 ] |
|
This is already supported with the quit() function: $ mongo $ echo $? |