diff --git a/lib/command.js b/lib/command.js index a8f41a672..40f02f34d 100644 --- a/lib/command.js +++ b/lib/command.js @@ -12,8 +12,6 @@ const { suggestSimilar } = require('./suggestSimilar'); // @ts-check -const PRODUCTION = process.env.NODE_ENV === 'production'; - class Command extends EventEmitter { /** * Initialize a new `Command`. @@ -905,7 +903,7 @@ Expecting one of '${allowedValues.join("', '")}'`); _parseSubroutine(async, userArgsCallback, argv, parseOptions) { const methodName = async ? 'parseAsync' : 'parse'; - if (!PRODUCTION && this.parent) { + if (this.parent) { console.warn(`Called .${methodName}() on subcommand '${this._name}'. Call on top-level command instead`); } @@ -934,7 +932,7 @@ Call on top-level command instead`); parse(argv, parseOptions) { return this._parseSubroutine(false, (userArgs) => { const result = this._parseCommand([], userArgs); - if (!PRODUCTION && isThenable(result)) { + if (isThenable(result)) { console.warn(`.parse() is incompatible with async hooks and actions. Use .parseAsync() instead.`); }