0
目前我的代码看起来是这样的:如何使Vorpal输出命令的说明
var vorpal = require('vorpal')();
console.log("Are you sure you wish to investigate the murder?")
vorpal
.delimiter('grey9nr$')
.show();
vorpal.command('Yes')
.action(function(args, cb){
const self = this;
this.prompt({
type: 'confirm',
name: 'continue',
default: false,
message: 'That sounds like a really bad idea. Continue?',
}, function(result){
if (result.continue) {
self.log('Good move.');
cb();
} else {
self.log('Your life is in danger. We will contact you with more information in due course.');
app.destroyDatabase(cb);
}
});
});
导致以下:
我想能够定义什么是意味着让玩家知道回答“是”会做什么,或者要求他们去做。
感谢花花公子。我会很快将它添加到网站中。 –