Skip to content

docs: update help text for readability in Repeat example and README #787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Examples/repeat/Repeat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ArgumentParser

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

@Flag(help: "Include a counter with each repetition.")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct Repeat: ParsableCommand {
@Flag(help: "Include a counter with each repetition.")
var includeCounter = false

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

@Argument(help: "The phrase to repeat.")
Expand Down
8 changes: 4 additions & 4 deletions Tests/ArgumentParserExampleTests/RepeatExampleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ final class RepeatExampleTests: XCTestCase {
<phrase> The phrase to repeat.

OPTIONS:
--count <count> The number of times to repeat 'phrase'.
--count <count> How many times to repeat 'phrase'.
--include-counter Include a counter with each repetition.
-h, --help Show help information.

Expand All @@ -84,7 +84,7 @@ final class RepeatExampleTests: XCTestCase {
<phrase> The phrase to repeat.

OPTIONS:
--count <count> The number of times to repeat 'phrase'.
--count <count> How many times to repeat 'phrase'.
--include-counter Include a counter with each repetition.
-h, --help Show help information.

Expand All @@ -96,7 +96,7 @@ final class RepeatExampleTests: XCTestCase {
command: "repeat hello --count",
expected: """
Error: Missing value for '--count <count>'
Help: --count <count> The number of times to repeat 'phrase'.
Help: --count <count> How many times to repeat 'phrase'.
Usage: repeat [--count <count>] [--include-counter] <phrase>
See 'repeat --help' for more information.

Expand All @@ -107,7 +107,7 @@ final class RepeatExampleTests: XCTestCase {
command: "repeat hello --count ZZZ",
expected: """
Error: The value 'ZZZ' is invalid for '--count <count>'
Help: --count <count> The number of times to repeat 'phrase'.
Help: --count <count> How many times to repeat 'phrase'.
Usage: repeat [--count <count>] [--include-counter] <phrase>
See 'repeat --help' for more information.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repeat [--count=<count>] [--include-counter] <phrase> [--help]

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

*The number of times to repeat 'phrase'.*
*How many times to repeat 'phrase'.*


- term **--include-counter**:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repeat [--count=<count>] [--include-counter] <phrase> [--help]

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

*The number of times to repeat 'phrase'.*
*How many times to repeat 'phrase'.*


**--include-counter:**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.Sh DESCRIPTION
.Bl -tag -width 6n
.It Fl -count Ar count
The number of times to repeat 'phrase'.
How many times to repeat 'phrase'.
.It Fl -include-counter
Include a counter with each repetition.
.It Ar phrase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.Sh DESCRIPTION
.Bl -tag -width 6n
.It Fl -count Ar count
The number of times to repeat 'phrase'.
How many times to repeat 'phrase'.
.It Fl -include-counter
Include a counter with each repetition.
.It Ar phrase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import XCTest

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

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

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

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

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

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

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

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

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

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

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

init() {}
Expand Down