Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit 0cac7e0

Browse files
committed
fix tcb help command output missing tips
1 parent 4b132a5 commit 0cac7e0

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

bin/tcb.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const CheckInterval = isBeta ? 3600000 : ONE_DAY
1515

1616
const notifier = updateNotifier({
1717
pkg,
18-
distTag: isBeta ? 'beta': 'latest',
18+
distTag: isBeta ? 'beta' : 'latest',
1919
// 检查更新间隔 1 天
2020
updateCheckInterval: CheckInterval
2121
})
@@ -35,24 +35,26 @@ program.action(cmd => {
3535
console.log(`使用 ${chalk.bold('tcb -h')} 查看所有命令~`)
3636
})
3737

38-
// 当没有输入任何命令时,显示帮助信息
39-
if (process.argv.length < 3) {
40-
program.outputHelp()
38+
program.on('--help', function() {
4139
const tips = `\nTips:
4240
43-
${chalk.gray('–')} 登录
44-
45-
${chalk.cyan('$ tcb login')}
46-
47-
${chalk.gray('–')} 列出环境列表
48-
49-
${chalk.cyan('$ tcb env:list')}
50-
51-
${chalk.gray('–')} 部署云函数
52-
53-
${chalk.cyan('$ tcb functions:deploy')}`
41+
${chalk.gray('–')} 登录
42+
43+
${chalk.cyan('$ tcb login')}
44+
45+
${chalk.gray('–')} 列出环境列表
46+
47+
${chalk.cyan('$ tcb env:list')}
5448
49+
${chalk.gray('–')} 部署云函数
50+
51+
${chalk.cyan('$ tcb functions:deploy')}`
5552
console.log(tips)
53+
})
54+
55+
// 当没有输入任何命令时,显示帮助信息
56+
if (process.argv.length < 3) {
57+
program.outputHelp()
5658
}
5759

5860
program.parse(process.argv)

0 commit comments

Comments
 (0)