Skip to content

Commit 83ad8da

Browse files
docs: update help text for readability in Repeat example and README (#787)
* docs: update help text for readability in Repeat example and README * Update help text snapshots for repeat command to fix test failures
1 parent d075877 commit 83ad8da

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

Examples/repeat/Repeat.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ArgumentParser
1313

1414
@main
1515
struct Repeat: ParsableCommand {
16-
@Option(help: "The number of times to repeat 'phrase'.")
16+
@Option(help: "How many times to repeat 'phrase'.")
1717
var count: Int? = nil
1818

1919
@Flag(help: "Include a counter with each repetition.")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct Repeat: ParsableCommand {
1818
@Flag(help: "Include a counter with each repetition.")
1919
var includeCounter = false
2020

21-
@Option(name: .shortAndLong, help: "The number of times to repeat 'phrase'.")
21+
@Option(name: .shortAndLong, help: "How many times to repeat 'phrase'.")
2222
var count: Int? = nil
2323

2424
@Argument(help: "The phrase to repeat.")

Tests/ArgumentParserExampleTests/RepeatExampleTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ final class RepeatExampleTests: XCTestCase {
6161
<phrase> The phrase to repeat.
6262
6363
OPTIONS:
64-
--count <count> The number of times to repeat 'phrase'.
64+
--count <count> How many times to repeat 'phrase'.
6565
--include-counter Include a counter with each repetition.
6666
-h, --help Show help information.
6767
@@ -84,7 +84,7 @@ final class RepeatExampleTests: XCTestCase {
8484
<phrase> The phrase to repeat.
8585
8686
OPTIONS:
87-
--count <count> The number of times to repeat 'phrase'.
87+
--count <count> How many times to repeat 'phrase'.
8888
--include-counter Include a counter with each repetition.
8989
-h, --help Show help information.
9090
@@ -96,7 +96,7 @@ final class RepeatExampleTests: XCTestCase {
9696
command: "repeat hello --count",
9797
expected: """
9898
Error: Missing value for '--count <count>'
99-
Help: --count <count> The number of times to repeat 'phrase'.
99+
Help: --count <count> How many times to repeat 'phrase'.
100100
Usage: repeat [--count <count>] [--include-counter] <phrase>
101101
See 'repeat --help' for more information.
102102
@@ -107,7 +107,7 @@ final class RepeatExampleTests: XCTestCase {
107107
command: "repeat hello --count ZZZ",
108108
expected: """
109109
Error: The value 'ZZZ' is invalid for '--count <count>'
110-
Help: --count <count> The number of times to repeat 'phrase'.
110+
Help: --count <count> How many times to repeat 'phrase'.
111111
Usage: repeat [--count <count>] [--include-counter] <phrase>
112112
See 'repeat --help' for more information.
113113

Tests/ArgumentParserGenerateDoccReferenceTests/Snapshots/testRepeatDoccReference().md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repeat [--count=<count>] [--include-counter] <phrase> [--help]
88

99
- term **--count=\<count\>**:
1010

11-
*The number of times to repeat 'phrase'.*
11+
*How many times to repeat 'phrase'.*
1212

1313

1414
- term **--include-counter**:

Tests/ArgumentParserGenerateDoccReferenceTests/Snapshots/testRepeatMarkdownReference().md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repeat [--count=<count>] [--include-counter] <phrase> [--help]
88

99
**--count=\<count\>:**
1010

11-
*The number of times to repeat 'phrase'.*
11+
*How many times to repeat 'phrase'.*
1212

1313

1414
**--include-counter:**

Tests/ArgumentParserGenerateManualTests/Snapshots/testRepeatMultiPageManual().mdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
.Sh DESCRIPTION
1515
.Bl -tag -width 6n
1616
.It Fl -count Ar count
17-
The number of times to repeat 'phrase'.
17+
How many times to repeat 'phrase'.
1818
.It Fl -include-counter
1919
Include a counter with each repetition.
2020
.It Ar phrase

Tests/ArgumentParserGenerateManualTests/Snapshots/testRepeatSinglePageManual().mdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
.Sh DESCRIPTION
1515
.Bl -tag -width 6n
1616
.It Fl -count Ar count
17-
The number of times to repeat 'phrase'.
17+
How many times to repeat 'phrase'.
1818
.It Fl -include-counter
1919
Include a counter with each repetition.
2020
.It Ar phrase

Tests/ArgumentParserUnitTests/ParsableArgumentsValidationTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import XCTest
1616

1717
final class ParsableArgumentsValidationTests: XCTestCase {
1818
private struct A: ParsableCommand {
19-
@Option(help: "The number of times to repeat 'phrase'.")
19+
@Option(help: "How many times to repeat 'phrase'.")
2020
var count: Int?
2121

2222
@Argument(help: "The phrase to repeat.")
@@ -31,7 +31,7 @@ final class ParsableArgumentsValidationTests: XCTestCase {
3131
}
3232

3333
private struct B: ParsableCommand {
34-
@Option(help: "The number of times to repeat 'phrase'.")
34+
@Option(help: "How many times to repeat 'phrase'.")
3535
var count: Int?
3636

3737
@Argument(help: "The phrase to repeat.")
@@ -41,7 +41,7 @@ final class ParsableArgumentsValidationTests: XCTestCase {
4141
}
4242

4343
private struct C: ParsableCommand {
44-
@Option(help: "The number of times to repeat 'phrase'.")
44+
@Option(help: "How many times to repeat 'phrase'.")
4545
var count: Int?
4646

4747
@Argument(help: "The phrase to repeat.")
@@ -58,7 +58,7 @@ final class ParsableArgumentsValidationTests: XCTestCase {
5858
@Argument(help: "The phrase to repeat.")
5959
var phrase: String
6060

61-
@Option(help: "The number of times to repeat 'phrase'.")
61+
@Option(help: "How many times to repeat 'phrase'.")
6262
var count: Int?
6363

6464
enum CodingKeys: String, CodingKey {
@@ -70,7 +70,7 @@ final class ParsableArgumentsValidationTests: XCTestCase {
7070
@Argument(help: "The phrase to repeat.")
7171
var phrase: String
7272

73-
@Option(help: "The number of times to repeat 'phrase'.")
73+
@Option(help: "How many times to repeat 'phrase'.")
7474
var count: Int?
7575

7676
@Flag(help: "Include a counter with each repetition.")
@@ -128,7 +128,7 @@ final class ParsableArgumentsValidationTests: XCTestCase {
128128
@Argument(help: "The phrase to repeat.")
129129
var phrase: String = ""
130130

131-
@Option(help: "The number of times to repeat 'phrase'.")
131+
@Option(help: "How many times to repeat 'phrase'.")
132132
var count: Int = 0
133133

134134
init() {}

0 commit comments

Comments
 (0)