Created
January 27, 2014 14:23
-
-
Save tekwiz/8649389 to your computer and use it in GitHub Desktop.
Mongorc Pretty Output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prompt = { | |
cmdCount: 1, | |
host: function() { | |
if(db.serverStatus().ok == false) { | |
if(db.serverStatus().errmsg == "need to login") { | |
return "unauthorized"; | |
} else { | |
return "error" | |
} | |
} else { | |
return db.serverStatus().host; | |
} | |
throw "Logic error in Prompt.host() !!" // safety. This should never be executed | |
}, | |
prompt: function() { | |
return db + "@" + Prompt.host() + " " + (Prompt.cmdCount++) + "> "; | |
} | |
} | |
prompt = Prompt.prompt; | |
DBQuery.prototype._prettyShell = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment