diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-09-05 12:02:19 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-09-05 12:52:06 +0200 |
commit | 893675249d9e3e20f198e8c25783b04c823dec39 (patch) | |
tree | b306f1e9b97390173ca521d017af8e49d10f5456 /source | |
parent | f5b82ca466dfdeb866062132d0fe495bee70f9f2 (diff) | |
download | mupdf-893675249d9e3e20f198e8c25783b04c823dec39.tar.xz |
mutool run: Pass script path and arguments as scriptPath and scriptArgs.
Diffstat (limited to 'source')
-rw-r--r-- | source/tools/murun.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c index 02144df4..810b32ce 100644 --- a/source/tools/murun.c +++ b/source/tools/murun.c @@ -4882,12 +4882,14 @@ int murun_main(int argc, char **argv) "a[4] * b[1] + a[5] * b[3] + b[5]];}"); if (argc > 1) { + js_pushstring(J, argv[1]); + js_setglobal(J, "scriptPath"); js_newarray(J); - for (i = 1; i < argc; ++i) { + for (i = 2; i < argc; ++i) { js_pushstring(J, argv[i]); - js_setindex(J, -2, i - 1); + js_setindex(J, -2, i - 2); } - js_setglobal(J, "argv"); + js_setglobal(J, "scriptArgs"); if (js_dofile(J, argv[1])) return 1; } else { |