diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 2c82376c..8d8a1772 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -382,7 +382,7 @@ const Bookmarks = Module("bookmarks", { } }); else { - let url = args.string || buffer.URL; + let url = args[0] || buffer.URL; let deletedCount = bookmarks.remove(url); dactyl.echomsg({ domains: [util.getHost(url)], message: deletedCount + " bookmark(s) with url " + url.quote() + " deleted" }, diff --git a/common/content/browser.js b/common/content/browser.js index e709cca7..b5c4e1f5 100644 --- a/common/content/browser.js +++ b/common/content/browser.js @@ -171,10 +171,8 @@ const Browser = Module("browser", { commands.add(["o[pen]"], "Open one or more URLs in the current tab", function (args) { - args = args.string; - - if (args) - dactyl.open(args); + if (args[0]) + dactyl.open(args[0]); else dactyl.open("about:blank"); }, { diff --git a/common/content/commandline.js b/common/content/commandline.js index 05a96f23..240ad7d2 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1437,7 +1437,7 @@ const CommandLine = Module("commandline", { commands.add([command.name], command.description, function (args) { - let str = CommandLine.echoArgumentToString(args.string, true); + let str = CommandLine.echoArgumentToString(args[0], true); if (str != null) command.action(str); }, { diff --git a/common/content/dactyl.js b/common/content/dactyl.js index ee21abab..95722cf6 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1415,13 +1415,13 @@ const Dactyl = Module("dactyl", { "Execute the argument as an Ex command", function (args) { try { - let cmd = dactyl.userEval(args.string); + let cmd = dactyl.userEval(args[0]); dactyl.execute(cmd, null, true); } catch (e) { dactyl.echoerr(e); } - }); + }, { literal: 0 }); /////////////////////////////////////////////////////////////////////////// @@ -1736,15 +1736,17 @@ const Dactyl = Module("dactyl", { commands.add(["norm[al]"], "Execute Normal mode commands", - function (args) { events.feedkeys(args.string, args.bang); }, + function (args) { events.feedkeys(args[0], args.bang); }, { argCount: "+", - bang: true + bang: true, + literal: 0 }); commands.add(["optionu[sage]"], "List all options with a short description", - function (args) { Dactyl.showHelpIndex("option-index", options, args.bang); }, { + function (args) { Dactyl.showHelpIndex("option-index", options, args.bang); }, + { argCount: "0", bang: true }); @@ -1804,7 +1806,7 @@ const Dactyl = Module("dactyl", { function (args) { let count = args.count; let special = args.bang; - args = args.string; + args = args[0]; if (args[0] == ":") var method = function () dactyl.execute(args, null, true); diff --git a/common/content/events.js b/common/content/events.js index 97f2c69f..190235be 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -1126,17 +1126,18 @@ const Events = Module("events", { commands.add(["delmac[ros]"], "Delete macros", function (args) { - dactyl.assert(!args.bang || !args.string, "E474: Invalid argument"); + dactyl.assert(!args.bang || !args[0], "E474: Invalid argument"); if (args.bang) events.deleteMacros(); - else if (args.string) - events.deleteMacros(args.string); + else if (args[0]) + events.deleteMacros(args[0]); else dactyl.echoerr("E471: Argument required"); }, { bang: true, - completer: function (context) completion.macro(context) + completer: function (context) completion.macro(context), + literal: 0 }); commands.add(["macros"], diff --git a/common/content/marks.js b/common/content/marks.js index 0cbbe39c..39d907af 100644 --- a/common/content/marks.js +++ b/common/content/marks.js @@ -225,7 +225,7 @@ const Marks = Module("marks", { "Delete the specified marks", function (args) { let special = args.bang; - args = args.string; + args = args[0]; // assert(special ^ args) dactyl.assert( special || args, "E471: Argument required"); @@ -249,7 +249,8 @@ const Marks = Module("marks", { }, { bang: true, - completer: function (context) completion.mark(context) + completer: function (context) completion.mark(context), + literal: 0 }); commands.add(["ma[rk]"], @@ -267,7 +268,7 @@ const Marks = Module("marks", { commands.add(["marks"], "Show all location marks of current web page", function (args) { - args = args.string; + args = args[0]; // ignore invalid mark characters unless there are no valid mark chars dactyl.assert(!args || /[a-zA-Z]/.test(args), @@ -275,6 +276,8 @@ const Marks = Module("marks", { let filter = args.replace(/[^a-zA-Z]/g, ""); marks.list(filter); + }, { + literal: 0 }); }, diff --git a/common/content/options.js b/common/content/options.js index 66baedf9..ae8c2605 100644 --- a/common/content/options.js +++ b/common/content/options.js @@ -1195,7 +1195,7 @@ const Options = Module("options", { commands.add(["let"], "Set or list a variable", function (args) { - args = args.string; + args = args[0]; if (!args) { let str = diff --git a/common/content/quickmarks.js b/common/content/quickmarks.js index 9b33b12e..f87b43e6 100644 --- a/common/content/quickmarks.js +++ b/common/content/quickmarks.js @@ -117,21 +117,22 @@ const QuickMarks = Module("quickmarks", { "Delete the specified QuickMarks", function (args) { // TODO: finish arg parsing - we really need a proper way to do this. :) - // assert(args.bang ^ args.string) - dactyl.assert( args.bang || args.string, "E471: Argument required"); - dactyl.assert(!args.bang || !args.string, "E474: Invalid argument"); + // assert(args.bang ^ args[0]) + dactyl.assert( args.bang || args[0], "E471: Argument required"); + dactyl.assert(!args.bang || !args[0], "E474: Invalid argument"); if (args.bang) quickmarks.removeAll(); else - quickmarks.remove(args.string); + quickmarks.remove(args[0]); }, { bang: true, completer: function (context) { context.title = ["QuickMark", "URL"]; context.completions = this._qmarks; - } + }, + literal: 0 }); commands.add(["qma[rk]"], @@ -156,13 +157,15 @@ const QuickMarks = Module("quickmarks", { commands.add(["qmarks"], "Show all QuickMarks", function (args) { - args = args.string; + args = args[0]; // ignore invalid qmark characters unless there are no valid qmark chars dactyl.assert(!args || /[a-zA-Z0-9]/.test(args), "E283: No QuickMarks matching " + args.quote()); let filter = args.replace(/[^a-zA-Z0-9]/g, ""); quickmarks.list(filter); + }, { + literal: 0 }); }, mappings: function () { diff --git a/common/content/tabs.js b/common/content/tabs.js index f0a2a82a..d2d16d7c 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -591,7 +591,7 @@ const Tabs = Module("tabs", { "Execute a command and tell it to output in a new tab", function (args) { dactyl.forceNewTab = true; - dactyl.execute(args.string, null, true); + dactyl.execute(args[0], null, true); dactyl.forceNewTab = false; }, { argCount: "+", @@ -605,7 +605,7 @@ const Tabs = Module("tabs", { function (args) { for (let i = 0; i < tabs.count; i++) { tabs.select(i); - dactyl.execute(args.string, null, true); + dactyl.execute(args[0], null, true); } }, { argCount: "1", @@ -756,7 +756,7 @@ const Tabs = Module("tabs", { commands.add(["tabopen", "t[open]", "tabnew"], "Open one or more URLs in a new tab", function (args) { - dactyl.open(args.string || "about:blank", { from: "tabopen", where: dactyl.NEW_TAB, background: args.bang }); + dactyl.open(args[0] || "about:blank", { from: "tabopen", where: dactyl.NEW_TAB, background: args.bang }); }, { bang: true, completer: function (context) completion.url(context), diff --git a/pentadactyl/content/config.js b/pentadactyl/content/config.js index 401a8445..0230b4e0 100644 --- a/pentadactyl/content/config.js +++ b/pentadactyl/content/config.js @@ -203,7 +203,7 @@ const Config = Module("config", ConfigBase, { "Execute a command and tell it to output in a new window", function (args) { dactyl.forceNewWindow = true; - dactyl.execute(args.string, null, true); + dactyl.execute(args[0], null, true); dactyl.forceNewWindow = false; }, { @@ -221,10 +221,8 @@ const Config = Module("config", ConfigBase, { commands.add(["wino[pen]", "wo[pen]"], "Open one or more URLs in a new window", function (args) { - args = args.string; - - if (args) - dactyl.open(args, dactyl.NEW_WINDOW); + if (args[0]) + dactyl.open(args[0], dactyl.NEW_WINDOW); else dactyl.open("about:blank", dactyl.NEW_WINDOW); },