Skip to content

Commit 263a141

Browse files
authored
Merge pull request #12 from dkushner/patch-1
Update README.md
2 parents 49d85a7 + 4a76ad0 commit 263a141

File tree

1 file changed

+24
-26
lines changed

1 file changed

+24
-26
lines changed

README.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# commandpost [![Circle CI](https://circleci.com/gh/vvakame/commandpost.png?style=badge)](https://circleci.com/gh/vvakame/commandpost)
22

3-
commandpost is a command-line option parser.
4-
This library inspired by [commander](https://www.npmjs.com/package/commander).
3+
commandpost is a command-line options parser.
4+
This library is inspired by [commander](https://www.npmjs.com/package/commander).
55

6-
commander is very user friendly, but not [TypeScript](https://www.npmjs.com/package/typescript) friendly.
7-
commandpost is improve it.
8-
Of course, commandpost can also be used from ordinary JavaScript program. :+1:
6+
commander is very user-friendly, but not [TypeScript](https://www.npmjs.com/package/typescript)-friendly.
7+
commandpost aims to improve this.
8+
Of course, commandpost can also be used from an ordinary JavaScript program. :+1:
99

1010
## Installation
1111

1212
```
1313
$ npm install --save commandpost
1414
```
1515

16-
## How to use
16+
## How to Use
1717

18-
### Basic usage
18+
### Basic Usage
1919

2020
```
2121
$ cat cli.ts
@@ -52,44 +52,42 @@ $ node cli.js -s "soy sause" "fillet steak"
5252
Your dinner is fillet steak with soy sause!
5353
```
5454

55-
### Command
55+
### Commands
5656

57-
top level command is created by `commandpost.create` function.
57+
A top-level command is created by the `commandpost.create` function.
5858

59-
commandpost can have a sub command.
60-
sub command is created by `topLevelCommand.subCommand` method.
61-
like [this](https://github.com/vvakame/commandpost/blob/master/example/usage.ts#L36).
59+
commandpost also supports sub-commands.
60+
A sub-command is created by using the `topLevelCommand.subCommand` method.
61+
Refer to [this](https://github.com/vvakame/commandpost/blob/master/example/usage.ts#L36) example for a demonstration.
6262

63-
commandpost can configure several items.
64-
e.g. version information, app description, CLI usage and help message.
65-
I recommend that you should setup `.version` and `.description`.
66-
Usually, automatic generated help message satisfy you.
63+
commandpost can automatically generate help and command usage messages based on your configuration. For best results, it is recommended that you should set `.version` and `.description` for your top-level command.
6764

68-
### Option
65+
66+
### Options
6967

7068
```
71-
// shorthand style & formal style option with required parameter. option value is convert to string[].
69+
// shorthand & formal option with a required parameter. value is converted to string[].
7270
cmd.option("-c, --config <configFile>", "Read setting from specified config file path");
7371
74-
// option with optional parameter. option value is convert to string[].
72+
// option with optional parameter. value is converted to string[].
7573
cmd.option("-c, --config [configFile]", "Read setting from specified config file path");
7674
77-
// option without parameter. option value is convert to boolean. default false.
75+
// option without parameter (flag). option value is converted to boolean and defaults to `false`.
7876
cmd.option("--suppress-warning", "Suppress warning");
7977
80-
// option with `--no-` prefix. option value is convert to boolean. default true.
78+
// option with `--no-` prefix. option value is converted to boolean and defaults to true.
8179
cmd.option("--no-type-checking", "Type checking disabled");
8280
```
8381

84-
If you want to handling unknown options, You can use `.allowUnknownOption` method.
82+
If you want to handle unknown options, you can use the `.allowUnknownOption` method.
8583

86-
### Argument
84+
### Arguments
8785

8886
```
8987
// required argument
9088
commandpost.create<{}, { food: string; }>("dinner <food>");
9189
92-
// optonal argument
90+
// optional argument
9391
commandpost.create<{}, { food: string; }>("dinner [food]");
9492
9593
// variadic argument
@@ -106,5 +104,5 @@ commandpost.create<{}, { foods: string[]; }>("dinner <food...>");
106104

107105
## Contributing
108106

109-
This package's author vvakame is not native english speaker. My first language is Japanese.
110-
If you find incorrect english, please send me a pull request.
107+
This package's author, vvakame, is not a native English speaker. My first language is Japanese.
108+
If you find incorrect English, please send me a pull request.

0 commit comments

Comments
 (0)