Add 'plain' protocol (no prompts, no welcome message). JSSh only - Not part of default build.

git-svn-id: svn://10.0.0.236/trunk@199699 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
alex%croczilla.com 2006-06-12 14:03:31 +00:00
parent 23a0387e07
commit 2e443a2fdf

View File

@ -268,10 +268,17 @@ SetProtocol(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if (!strcmp(protocol, "interactive")) {
shell->mEmitHeader = PR_FALSE;
shell->mPrompt = NS_LITERAL_CSTRING("\n> ");
shell->mProtocol = protocol;
}
else if (!strcmp(protocol, "synchronous")) {
shell->mEmitHeader = PR_TRUE;
shell->mPrompt = NS_LITERAL_CSTRING("\n> ");
shell->mProtocol = protocol;
}
else if (!strcmp(protocol, "plain")) {
shell->mEmitHeader = PR_FALSE;
shell->mPrompt = NS_LITERAL_CSTRING("\n");
shell->mProtocol = protocol;
}
else return JS_FALSE;
@ -476,7 +483,7 @@ NS_IMETHODIMP nsJSSh::Run()
if (mInput) {
// read-eval-print loop
PRUint32 bytesWritten;
if (mOutput)
if (mOutput && mProtocol != NS_LITERAL_CSTRING("plain"))
mOutput->Write(gWelcome, strlen(gWelcome), &bytesWritten);
while (!mQuit) {