UNPKG

cli-engine

Version:
34 lines (26 loc) 982 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _cliEngineCommand = require('cli-engine-command'); var _cliEngineCommand2 = _interopRequireDefault(_cliEngineCommand); var _plugins = require('../plugins'); var _plugins2 = _interopRequireDefault(_plugins); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class _class extends _cliEngineCommand2.default { async run() { this.plugins = new _plugins2.default(this.out); const [command] = this.argv; const plugin = await this.plugins.findPluginWithCommand(command); if (!plugin) throw new Error('not found'); if (plugin.type === 'builtin') { this.out.log('builtin command'); } else { this.out.log(`Command from ${plugin.type} plugin ${plugin.name}`); } } } exports.default = _class; _class.topic = 'which'; _class.description = 'show which plugin a command is from'; _class.args = [{ name: 'command' }];