mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-29 10:02:14 +00:00
Add "-e" shell option to evaluate string argument directly
This commit is contained in:
parent
f645855603
commit
520a56ffdb
1 changed files with 8 additions and 0 deletions
|
|
@ -136,6 +136,14 @@ int main(int argc, char* argv[])
|
|||
if (strcmp(argv[i], "--shell") == 0) {
|
||||
runShell = true;
|
||||
}
|
||||
if (strcmp(argv[i], "-e") == 0) {
|
||||
runShell = false;
|
||||
i++;
|
||||
Escargot::String* src = new Escargot::ASCIIString(argv[i], strlen(argv[i]));
|
||||
const char* source = "shell input";
|
||||
if (!eval(context, src, Escargot::String::fromUTF8(source, strlen(source)), false))
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue