1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 12:27:58 +01:00

Add arg validation to :pageinfo.

This commit is contained in:
Doug Kearns
2011-01-24 12:21:22 +11:00
parent 5415cad4e7
commit 05e0dd6f6b

View File

@@ -1423,7 +1423,13 @@ var Buffer = Module("buffer", {
commands.add(["pa[geinfo]"], commands.add(["pa[geinfo]"],
"Show various page information", "Show various page information",
function (args) { buffer.showPageInfo(true, args[0]); }, function (args) {
let arg = args[0];
let opt = options.get("pageinfo");
dactyl.assert(opt.validator(opt.parse(arg)), "E475: Invalid argument: " + arg);
buffer.showPageInfo(true, arg);
},
{ {
argCount: "?", argCount: "?",
completer: function (context) { completer: function (context) {