Skip to content

Commit a9147aa

Browse files
committed
update README
1 parent d7f6d9f commit a9147aa

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ Commander会根据配置的option,sub-command等信息,自动生成help信
348348

349349
可以通过监听--help事件来输出额外的帮助信息,如下面给fe命令添加了一些examples
350350

351-
```
351+
```js
352352
// must be before .parse() since node's emit() is immediate
353353
program.on('--help', function () {
354354
console.log(' 自定义的例子:')
@@ -363,7 +363,7 @@ program.parse(process.argv);
363363

364364
效果如下:
365365

366-
```
366+
```shell
367367
./bin/wcj.js -h
368368

369369
Usage: wcj [options]
@@ -385,7 +385,7 @@ program.parse(process.argv);
385385

386386
[列子源码](https://github.com/jaywcjlove/wcj/blob/master/examples/gitstyle.js)
387387

388-
```
388+
```js
389389
#!/usr/bin/env node
390390
var program = require('commander');
391391
var appInfo = require('./../package.json');
@@ -423,7 +423,7 @@ program.parse(process.argv);
423423

424424
上面实例运行输出方式
425425

426-
```
426+
```shell
427427
$ ./bin/wcj.js resume ss -n aaaaa
428428

429429
#输出:
@@ -438,7 +438,7 @@ resume "aa" 使用 模式
438438

439439
命名多少个命令就监听多少命令,`--help` 为默认监听事件。
440440

441-
```
441+
```shell
442442
program.on('--help', function(argv,test){
443443
process.exit(1);
444444
});

0 commit comments

Comments
 (0)