次の vorpal コマンドを追加しました。
vorpal
.command('connect [username] [password]')
.description('Connect to server.')
.action(function (args, callback) {
setTimeout(function () {
// deleting options key from args
delete args.options;
var context = domain.create();
// error handling in domain
context.on('error', errorHandler);
// running the connect in domain
context.run(function() {
console.log("Arguments : ", args);
});
}, 0);
});
vorpal.delimiter('hdb$').show();
以下は、vorpal ライブラリのみで生成されたスタック トレースです。
Vorpal Prompt error: TypeError: Cannot read property 'setRawMode' of null
at ReadStream.setRawMode (tty.js:67:15)
at Interface._setRawMode (readline.js:177:23)
at new Interface (readline.js:137:10)
at Object.exports.createInterface (readline.js:39:10)
at Object.Interface.createInterface (/home/users/my-cli/node_modules/vorpal/node_modules/inquirer/node_modules/readline2/index.js:34:21)
at module.exports (/home/users/my-cli/node_modules/vorpal/node_modules/inquirer/lib/ui/baseUI.js:14:30)
at new module.exports (/home/users/my-cli/node_modules/vorpal/node_modules/inquirer/lib/ui/prompt.js:15:8)
at Object.promptModule as prompt
at Object.ui.prompt (/home/users/my-cli/node_modules/vorpal/lib/ui.js:171:25)
at EventEmitter.vorpal._prompt (/home/users/my-cli/node_modules/vorpal/lib/vorpal.js:528:15)
at EventEmitter. (/home/users/my-cli/node_modules/vorpal/lib/vorpal.js:542:12)
at callback (/home/users/my-cli/node_modules/vorpal/lib/vorpal.js:705:22)
at /home/users/my-cli/node_modules/vorpal/lib/vorpal.js:824:7
at EventEmitter._commandSetCallback (/home/users/my-cli/node_modules/vorpal/lib/session.js:455:5)
at EventEmitter.session.completeCommand (/home/users/my-cli/node_modules/vorpal/lib/session.js:519:12)
at onCompletion (/home/users/my-cli/node_modules/vorpal/lib/session.js:465:10)
これで何か間違ったことをしている場合はお知らせください。