Skip to content

Commit d967dbe

Browse files
committed
Make some additional small improvements to README
1 parent 24e9ef5 commit d967dbe

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ class MyArgs(parser: ArgParser) {
6262
"-N", "--name",
6363
help = "name of the user")
6464

65-
val size by parser.storing(
66-
"-s", "--size",
67-
help = "size of the plumbus") { toInt() }
65+
val count by parser.storing(
66+
"-c", "--count",
67+
help = "number of widgets") { toInt() }
6868

6969
val source by parser.positional(
7070
"SOURCE",
@@ -97,11 +97,11 @@ for a complete example project.
9797

9898
Options, arguments, flags... what's the difference?
9999

100-
Your application's `main` function is passed an array of strings. These are
100+
An application's `main` function is passed an array of strings. These are
101101
the *unparsed command-line arguments*, or *unparsed arguments* for short.
102102

103-
These unparsed arguments can then be parsed into either *options*, which start
104-
with a hyphen ("`-`"), or *positional arguments*. For example, in the command
103+
The unparsed arguments can then be parsed into *options*, which start
104+
with a hyphen ("`-`"), and *positional arguments*. For example, in the command
105105
`ls -l /tmp/`, the unparsed arguments would be `"-l", "/tmp"` where `-l`
106106
is an option, while `/tmp/` is a positional argument.
107107

@@ -111,7 +111,7 @@ parsing a single unparsed argument can be split into an option and an option
111111
argument, or even into multiple options in some cases.
112112

113113
A *flag* is a boolean option which has no arguments and which is false if not
114-
provided, but true if provided.
114+
provided, but true if provided. The `-l` option of `ls` is a flag.
115115

116116
## Option Types
117117

@@ -136,7 +136,7 @@ Single argument options are created by asking the parser for a
136136

137137
```kotlin
138138
val name by parser.storing("-N", "--name",
139-
help = "name of the widget")
139+
help = "name of the user")
140140
```
141141

142142
Here either `-N` or `--name` with an argument will cause the `name` property to
@@ -146,8 +146,8 @@ A function can also be supplied to transform the argument into the desired
146146
type. Here the `size` property will be an `Int` rather than a `String`:
147147

148148
```kotlin
149-
val size by parser.storing("-s", "--size",
150-
help = "size of the plumbus") { toInt() }
149+
val size by parser.storing("-c", "--count",
150+
help = "number of widgets") { toInt() }
151151
```
152152

153153
### Adding to a Collection

0 commit comments

Comments
 (0)