Skip to content

Commit da1eece

Browse files
committed
update verbiage
1 parent 85da077 commit da1eece

File tree

8 files changed

+45
-40
lines changed

8 files changed

+45
-40
lines changed

Sources/ArgumentParser/Documentation.docc/Articles/CustomizingCommandHelp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Customizing Help for Commands
22

3-
Define your command's abstract, extended discussion, or usage string, and set the flags used to invoke the help display.
3+
Define your command's abstract, discussion, or usage string, and set the flags used to invoke the help display.
44

55
## Overview
66

Sources/ArgumentParser/Parsable Properties/ArgumentHelp.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ public struct ArgumentHelp {
1717
/// An expanded description of the argument, in plain text form.
1818
public var discussion: String = ""
1919

20-
/// Additional description of the argument for supplemental content, in plain
21-
/// text form.
22-
public var supplementalDiscussion: String = ""
20+
/// Additional detailed description of the argument, in plain text form.
21+
///
22+
/// This discussion is shown in the detailed help display and supplemental
23+
/// content such as generated manuals.
24+
public var detailedDiscussion: String = ""
2325

2426
/// An alternative name to use for the argument's value when showing usage
2527
/// information.
@@ -36,13 +38,13 @@ public struct ArgumentHelp {
3638
public init(
3739
_ abstract: String = "",
3840
discussion: String = "",
39-
supplementalDiscussion: String = "",
41+
detailedDiscussion: String = "",
4042
valueName: String? = nil,
4143
visibility: ArgumentVisibility = .default)
4244
{
4345
self.abstract = abstract
4446
self.discussion = discussion
45-
self.supplementalDiscussion = supplementalDiscussion
47+
self.detailedDiscussion = detailedDiscussion
4648
self.valueName = valueName
4749
self.visibility = visibility
4850
}
@@ -79,7 +81,7 @@ extension ArgumentHelp {
7981
}
8082

8183
/// Creates a new help instance.
82-
@available(*, deprecated, message: "Use init(_:discussion:supplementalDiscussion:valueName:visibility:) instead.")
84+
@available(*, deprecated, message: "Use init(_:discussion:detailedDiscussion:valueName:visibility:) instead.")
8385
public init(
8486
_ abstract: String = "",
8587
discussion: String = "",
@@ -89,7 +91,7 @@ extension ArgumentHelp {
8991
self.init(
9092
abstract,
9193
discussion: discussion,
92-
supplementalDiscussion: "",
94+
detailedDiscussion: "",
9395
valueName: valueName,
9496
visibility: shouldDisplay ? .default : .hidden)
9597
}

Sources/ArgumentParser/Parsable Types/CommandConfiguration.swift

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public struct CommandConfiguration {
3939
/// display.
4040
public var discussion: String
4141

42-
/// Additional description of this command to be shown in supplemental content
43-
/// such as manuals.
44-
public var supplementalDiscussion: String
42+
/// Additional detailed description of the argument to be shown in the
43+
/// detailed help display and supplemental content such as generated manuals.
44+
public var detailedDiscussion: String
4545

4646
/// Version information for this command.
4747
public var version: String
@@ -71,8 +71,9 @@ public struct CommandConfiguration {
7171
/// automatically generating a usage description. Passing an empty string
7272
/// hides the usage string altogether.
7373
/// - discussion: A longer description of the command.
74-
/// - supplementalDiscussion: Additional description of the command for
75-
/// supplemental content.
74+
/// - detailedDiscussion: Additional detailed description to be shown in the
75+
/// detailed help display and supplemental content such as generated
76+
/// manuals.
7677
/// - version: The version number for this command. When you provide a
7778
/// non-empty string, the argument parser prints it if the user provides
7879
/// a `--version` flag.
@@ -91,7 +92,7 @@ public struct CommandConfiguration {
9192
abstract: String = "",
9293
usage: String? = nil,
9394
discussion: String = "",
94-
supplementalDiscussion: String = "",
95+
detailedDiscussion: String = "",
9596
version: String = "",
9697
shouldDisplay: Bool = true,
9798
subcommands: [ParsableCommand.Type] = [],
@@ -102,7 +103,7 @@ public struct CommandConfiguration {
102103
self.abstract = abstract
103104
self.usage = usage
104105
self.discussion = discussion
105-
self.supplementalDiscussion = supplementalDiscussion
106+
self.detailedDiscussion = detailedDiscussion
106107
self.version = version
107108
self.shouldDisplay = shouldDisplay
108109
self.subcommands = subcommands
@@ -118,7 +119,7 @@ public struct CommandConfiguration {
118119
abstract: String = "",
119120
usage: String? = nil,
120121
discussion: String = "",
121-
supplementalDiscussion: String = "",
122+
detailedDiscussion: String = "",
122123
version: String = "",
123124
shouldDisplay: Bool = true,
124125
subcommands: [ParsableCommand.Type] = [],
@@ -130,7 +131,7 @@ public struct CommandConfiguration {
130131
self.abstract = abstract
131132
self.usage = usage
132133
self.discussion = discussion
133-
self.supplementalDiscussion = ""
134+
self.detailedDiscussion = ""
134135
self.version = version
135136
self.shouldDisplay = shouldDisplay
136137
self.subcommands = subcommands
@@ -156,15 +157,15 @@ extension CommandConfiguration {
156157
abstract: abstract,
157158
usage: "",
158159
discussion: discussion,
159-
supplementalDiscussion: "",
160+
detailedDiscussion: "",
160161
version: version,
161162
shouldDisplay: shouldDisplay,
162163
subcommands: subcommands,
163164
defaultSubcommand: defaultSubcommand,
164165
helpNames: helpNames)
165166
}
166167

167-
@available(*, deprecated, message: "Use the member-wise initializer with the extendedDiscussion parameter.")
168+
@available(*, deprecated, message: "Use the member-wise initializer with the detailedDiscussion parameter.")
168169
public init(
169170
commandName: String?,
170171
abstract: String,
@@ -181,7 +182,7 @@ extension CommandConfiguration {
181182
abstract: abstract,
182183
usage: usage,
183184
discussion: discussion,
184-
supplementalDiscussion: "",
185+
detailedDiscussion: "",
185186
version: version,
186187
shouldDisplay: shouldDisplay,
187188
subcommands: subcommands,

Sources/ArgumentParser/Parsing/ArgumentDefinition.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct ArgumentDefinition {
5252
var isComposite: Bool
5353
var abstract: String
5454
var discussion: String
55-
var supplementalDiscussion: String
55+
var detailedDiscussion: String
5656
var valueName: String
5757
var visibility: ArgumentVisibility
5858
var parentTitle: String
@@ -72,7 +72,7 @@ struct ArgumentDefinition {
7272
self.isComposite = isComposite
7373
self.abstract = help?.abstract ?? ""
7474
self.discussion = help?.discussion ?? ""
75-
self.supplementalDiscussion = help?.supplementalDiscussion ?? ""
75+
self.detailedDiscussion = help?.detailedDiscussion ?? ""
7676
self.valueName = help?.valueName ?? ""
7777
self.visibility = help?.visibility ?? .default
7878
self.parentTitle = ""

Sources/ArgumentParser/Usage/DumpHelpGenerator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ fileprivate extension CommandInfoV0 {
114114
commandName: command._commandName,
115115
abstract: command.configuration.abstract,
116116
discussion: command.configuration.discussion,
117-
supplementalDiscussion: command.configuration.supplementalDiscussion,
117+
detailedDiscussion: command.configuration.detailedDiscussion,
118118
defaultSubcommand: defaultSubcommand,
119119
subcommands: subcommands,
120120
arguments: arguments)
@@ -137,7 +137,7 @@ fileprivate extension ArgumentInfoV0 {
137137
allValues: argument.help.allValues,
138138
abstract: argument.help.abstract,
139139
discussion: argument.help.discussion,
140-
supplementalDiscussion: argument.help.supplementalDiscussion)
140+
detailedDiscussion: argument.help.detailedDiscussion)
141141
}
142142
}
143143

Sources/ArgumentParserToolInfo/ToolInfo.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public struct CommandInfoV0: Codable, Hashable {
5353
public var discussion: String?
5454
/// Additional description of the command's functionality for supplemental
5555
/// content.
56-
public var supplementalDiscussion: String?
56+
public var detailedDiscussion: String?
5757

5858
/// Optional name of the subcommand invoked when the command is invoked with
5959
/// no arguments.
@@ -68,7 +68,7 @@ public struct CommandInfoV0: Codable, Hashable {
6868
commandName: String,
6969
abstract: String,
7070
discussion: String,
71-
supplementalDiscussion: String,
71+
detailedDiscussion: String,
7272
defaultSubcommand: String?,
7373
subcommands: [CommandInfoV0],
7474
arguments: [ArgumentInfoV0]
@@ -78,7 +78,7 @@ public struct CommandInfoV0: Codable, Hashable {
7878
self.commandName = commandName
7979
self.abstract = abstract.nonEmpty
8080
self.discussion = discussion.nonEmpty
81-
self.supplementalDiscussion = supplementalDiscussion.nonEmpty
81+
self.detailedDiscussion = detailedDiscussion.nonEmpty
8282

8383
self.defaultSubcommand = defaultSubcommand?.nonEmpty
8484
self.subcommands = subcommands.nonEmpty
@@ -151,9 +151,11 @@ public struct ArgumentInfoV0: Codable, Hashable {
151151
public var abstract: String?
152152
/// Extended description of the argument's functionality.
153153
public var discussion: String?
154-
/// Additional description of the argument's functionality for supplemental
155-
/// content.
156-
public var supplementalDiscussion: String?
154+
/// Additional detailed description of the argument's functionality
155+
///
156+
/// This discussion is shown in the detailed help display and supplemental
157+
/// content such as generated manuals.
158+
public var detailedDiscussion: String?
157159

158160
public init(
159161
kind: KindV0,
@@ -168,7 +170,7 @@ public struct ArgumentInfoV0: Codable, Hashable {
168170
allValues: [String]?,
169171
abstract: String?,
170172
discussion: String?,
171-
supplementalDiscussion: String?
173+
detailedDiscussion: String?
172174
) {
173175
self.kind = kind
174176

@@ -187,6 +189,6 @@ public struct ArgumentInfoV0: Codable, Hashable {
187189

188190
self.abstract = abstract?.nonEmpty
189191
self.discussion = discussion?.nonEmpty
190-
self.supplementalDiscussion = supplementalDiscussion?.nonEmpty
192+
self.detailedDiscussion = detailedDiscussion?.nonEmpty
191193
}
192194
}

Tools/generate-manual/DSL/Description.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ struct Description: MDocComponent {
2828
discussion
2929
}
3030

31-
if command.discussion != nil, command.supplementalDiscussion != nil {
31+
if command.discussion != nil, command.detailedDiscussion != nil {
3232
MDocMacro.ParagraphBreak()
3333
}
3434

35-
if let supplementalDiscussion = command.supplementalDiscussion {
36-
supplementalDiscussion
35+
if let detailedDiscussion = command.detailedDiscussion {
36+
detailedDiscussion
3737
}
3838

3939
List {
@@ -52,12 +52,12 @@ struct Description: MDocComponent {
5252
discussion
5353
}
5454

55-
if argument.discussion != nil, argument.supplementalDiscussion != nil {
55+
if argument.discussion != nil, argument.detailedDiscussion != nil {
5656
MDocMacro.ParagraphBreak()
5757
}
5858

59-
if let supplementalDiscussion = argument.supplementalDiscussion {
60-
supplementalDiscussion
59+
if let detailedDiscussion = argument.detailedDiscussion {
60+
detailedDiscussion
6161
}
6262
}
6363

Tools/generate-manual/GenerateManual.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct GenerateManual: ParsableCommand {
3131
using the plugin which can be invoked via \
3232
`swift package generate-manual`.
3333
""",
34-
supplementalDiscussion: """
34+
detailedDiscussion: """
3535
The generate-manual tool invokes provided executable with the \
3636
`--experimental-dump-help` argument and decoding the output into a \
3737
`ToolInfo` structure provided by the `ArgumentParserToolInfo` library. \
@@ -60,7 +60,7 @@ struct GenerateManual: ParsableCommand {
6060
Manuals for executables are typically included in section 1, but may \
6161
also be found in other sections such as section 8.
6262
""",
63-
supplementalDiscussion: """
63+
detailedDiscussion: """
6464
A description of manual sections is included below:
6565
1) General Commands
6666
2) System Calls

0 commit comments

Comments
 (0)