summaryrefslogtreecommitdiff
path: root/shell/dbshell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'shell/dbshell.cpp')
-rw-r--r--shell/dbshell.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/dbshell.cpp b/shell/dbshell.cpp
index b5dac976c80..0014b34f7ac 100644
--- a/shell/dbshell.cpp
+++ b/shell/dbshell.cpp
@@ -669,6 +669,8 @@ int _main(int argc, char* argv[]) {
shellHistoryInit();
+ string prompt;
+
//v8::Handle<v8::Object> shellHelper = baseContext_->Global()->Get( v8::String::New( "shellHelper" ) )->ToObject();
while ( 1 ) {
@@ -677,8 +679,11 @@ int _main(int argc, char* argv[]) {
// shellMainScope->localConnect;
//DBClientWithCommands *c = getConnection( JSContext *cx, JSObject *obj );
- string prompt(sayReplSetMemberState()+"> ");
-
+ if (scope->exec("prompt", "", false, false, false)) {
+ prompt = scope->getString("prompt");
+ } else {
+ prompt = sayReplSetMemberState()+"> ";
+ }
char * line = shellReadline( prompt.c_str() );
if ( line ) {