mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 06:58:00 +01:00
Be somewhat less insistent/more informative in deprecation complaints.
This commit is contained in:
@@ -131,9 +131,10 @@ const Command = Class("Command", {
|
||||
* @param {Object} modifiers Any modifiers to be passed to {@link #action}.
|
||||
*/
|
||||
execute: function (args, modifiers) {
|
||||
if (this.deprecated) {
|
||||
if (this.deprecated && !set.add(this.complained, io.sourcing ? io.sourcing.file : "[Command Line]")) {
|
||||
let loc = io.sourcing ? io.sourcing.file + ":" + io.sourcing.line + ": " : "";
|
||||
dactyl.echoerr(loc + ":" + this.name + " is deprecated");
|
||||
dactyl.echoerr(loc + ":" + this.name + " is deprecated" +
|
||||
(isString(this.deprecated) ? ": " + this.deprecated : ""));
|
||||
}
|
||||
|
||||
let self = this;
|
||||
@@ -180,6 +181,8 @@ const Command = Class("Command", {
|
||||
extra: extra
|
||||
}),
|
||||
|
||||
complained: Class.memoize(function () ({})),
|
||||
|
||||
/**
|
||||
* @property {string[]} All of this command's name specs. e.g., "com[mand]"
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user