diff --git a/common/content/commands.js b/common/content/commands.js index 6372bbe5..da1d0c4a 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -561,7 +561,7 @@ const Commands = Module("commands", { * Args object. * @returns {Args} */ - parseArgs: function (str, options, argCount, allowUnknownOptions, literal, complete, extra) { + parseArgs: function (str, params) { function getNextArg(str) { let [count, arg, quote] = Commands.parseArg(str, null, keepQuotes); if (quote == "\\" && !complete) @@ -571,10 +571,7 @@ const Commands = Module("commands", { return [count, arg, quote]; } - let keepQuotes; - - if (isObject(options)) - ({ allowUnknownOptions, argCount, complete, extra, literal, options, keepQuotes }) = options; + var { allowUnknownOptions, argCount, complete, extra, literal, options, keepQuotes } = params; if (!options) options = []; diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 7ba4fceb..d75a57fe 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1109,7 +1109,7 @@ const Dactyl = Module("dactyl", { [["+c"], CommandOption.STRING, null, null, true] ].map(CommandOption.fromArray, CommandOption); try { - return commands.parseArgs(cmdline, options, "*"); + return commands.parseArgs(cmdline, { options: options, argCount: "*" }); } catch (e) { dactyl.reportError(e, true); diff --git a/common/content/editor.js b/common/content/editor.js index 925f205f..7a3002a8 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -283,7 +283,7 @@ const Editor = Module("editor", { editFileExternally: function (path) { // TODO: save return value in v:shell_error - let args = commands.parseArgs(options["editor"], [], "*", true); + let args = commands.parseArgs(options["editor"], { argCount: "*", allowUnknownOptions: true }); dactyl.assert(args.length >= 1, "No editor specified");