mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-23 18:15:46 +01:00
Less confusing invalid argument errors.
This commit is contained in:
@@ -1113,7 +1113,7 @@ var Commands = Module("commands", {
|
|||||||
|
|
||||||
if (arg == null || (typeof arg == "number" && isNaN(arg))) {
|
if (arg == null || (typeof arg == "number" && isNaN(arg))) {
|
||||||
if (!complete || orig != "" || args.completeStart != str.length)
|
if (!complete || orig != "" || args.completeStart != str.length)
|
||||||
fail(_("command.invalidOptTypeArg", opt.type.description, optname, argString));
|
fail(_("command.invalidOptTypeArg", opt.type.description, optname, quoted));
|
||||||
if (complete)
|
if (complete)
|
||||||
complete.highlight(args.completeStart, count - 1, "SPELLCHECK");
|
complete.highlight(args.completeStart, count - 1, "SPELLCHECK");
|
||||||
}
|
}
|
||||||
@@ -1122,7 +1122,7 @@ var Commands = Module("commands", {
|
|||||||
// we have a validator function
|
// we have a validator function
|
||||||
if (typeof opt.validator == "function") {
|
if (typeof opt.validator == "function") {
|
||||||
if (opt.validator(arg, quoted) == false && (arg || !complete)) {
|
if (opt.validator(arg, quoted) == false && (arg || !complete)) {
|
||||||
fail(_("command.invalidOptArg", optname, argString));
|
fail(_("command.invalidOptArg", optname, quoted));
|
||||||
if (complete) // Always true.
|
if (complete) // Always true.
|
||||||
complete.highlight(args.completeStart, count - 1, "SPELLCHECK");
|
complete.highlight(args.completeStart, count - 1, "SPELLCHECK");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user