Skip to content

Instantly share code, notes, and snippets.

@tekwiz
Created January 27, 2014 14:23
Show Gist options
  • Save tekwiz/8649389 to your computer and use it in GitHub Desktop.
Save tekwiz/8649389 to your computer and use it in GitHub Desktop.
Mongorc Pretty Output
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