@@ -47,7 +47,7 @@ enum HelpTopic: ExpressibleByArgument, CustomStringConvertible {
4747}
4848
4949enum Subcommand : String , CaseIterable {
50- case build, package , run, test
50+ case build, package , run, test, repl
5151
5252 var description : String {
5353 switch self {
@@ -59,6 +59,8 @@ enum Subcommand: String, CaseIterable {
5959 return " Run a program from a package "
6060 case . test:
6161 return " Run package tests "
62+ case . repl:
63+ return " Experiment with Swift code interactively "
6264 }
6365 }
6466}
@@ -111,12 +113,6 @@ struct SwiftHelp: ParsableCommand {
111113 print ( " \( plainBold) swift \( command. rawValue) \( plain) \( padding) \( command. description) " )
112114 }
113115
114- // `repl` not included in `Subcommand`, also print it here.
115- do {
116- let padding = String ( repeating: " " , count: maxSubcommandNameLength - " repl " . count)
117- print ( " \( plainBold) swift repl \( plain) \( padding) Experiment with Swift code interactively " )
118- }
119-
120116 print ( " \n Use \( plainBold) `swift --version` \( plain) for Swift version information. " )
121117 print ( " \n Use \( plainBold) `swift --help` \( plain) for descriptions of available options and flags. " )
122118 print ( " \n Use \( plainBold) `swift help <subcommand>` \( plain) for more information about a subcommand. " )
@@ -131,6 +127,16 @@ struct SwiftHelp: ParsableCommand {
131127 if kind == . interactive {
132128 printIntro ( )
133129 }
130+ case . subcommand( . repl) :
131+ print ( """
132+ USAGE: swift repl <options>
133+
134+ The Swift REPL runs code interactively with LLDB.
135+ For most purposes, you can just run `swift repl`.
136+
137+ OPTIONS:
138+ This mode takes optional Swift Frontend arguments: see `swift --help`.
139+ """ )
134140 case . subcommand( let subcommand) :
135141 // Try to find the subcommand adjacent to the help tool.
136142 // If we didn't find the tool there, let the OS search for it.
0 commit comments