mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 05:07:59 +01:00
Fix command arg count validation.
This commit is contained in:
@@ -269,7 +269,7 @@ const Command = Class("Command", {
|
|||||||
get literalArg() this.command.literal != null && this[this.command.literal] || "",
|
get literalArg() this.command.literal != null && this[this.command.literal] || "",
|
||||||
// TODO: string: Class.memoize(function () { ... }),
|
// TODO: string: Class.memoize(function () { ... }),
|
||||||
verify: function verify() {
|
verify: function verify() {
|
||||||
if (this.argCount) {
|
if (this.command.argCount) {
|
||||||
dactyl.assert((this.length > 0 || !/^[1+]$/.test(this.command.argCount)) &&
|
dactyl.assert((this.length > 0 || !/^[1+]$/.test(this.command.argCount)) &&
|
||||||
(this.literal == null || !/[1+]/.test(this.command.argCount) || /\S/.test(this.literalArg || "")),
|
(this.literal == null || !/[1+]/.test(this.command.argCount) || /\S/.test(this.literalArg || "")),
|
||||||
"E471: Argument required");
|
"E471: Argument required");
|
||||||
|
|||||||
Reference in New Issue
Block a user