bunny-cli/bin/command-log.js

36 lines
875 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
npm config get registry // 先康康你的是否是npm官方的源不是请切回
npm config set registry https://registry.npmmirror.com
npm config set registry https://registry.npmjs.org
*/
const { program } = require('commander'); // 命令行提示工具
const figlet = require('figlet'); // 生成艺术字
module.exports = {
/**
* 给help信息添加提示
*/
CommandLogHelp() {
program.on('--help', function () {
console.log(
// 设置帮助信息下打印艺术字
figlet.textSync('Bunny-Cli', {
font: 'Ghost',
horizontalLayout: 'default',
verticalLayout: 'default',
width: 100,
whitespaceBreak: true,
}),
);
});
},
/**
* 给出version版本号
*/
CommandLogStart() {
program.name('bunny-cli').usage('<command> [options]');
program.version(`😉 v${require('../package.json').version}`);
},
};