|
2 | 2 | //
|
3 | 3 | // This source file is part of the Swift.org open source project
|
4 | 4 | //
|
5 |
| -// Copyright (c) 2020 Apple Inc. and the Swift project authors |
| 5 | +// Copyright (c) 2020-2022 Apple Inc. and the Swift project authors |
6 | 6 | // Licensed under Apache License v2.0 with Runtime Library Exception
|
7 | 7 | //
|
8 | 8 | // See https://swift.org/LICENSE.txt for license information
|
@@ -47,14 +47,16 @@ enum HelpTopic: ExpressibleByArgument, CustomStringConvertible {
|
47 | 47 | }
|
48 | 48 |
|
49 | 49 | enum Subcommand: String, CaseIterable {
|
50 |
| - case build, package, run, test |
| 50 | + case build, package, packageRegistry = "package-registry", run, test |
51 | 51 |
|
52 | 52 | var description: String {
|
53 | 53 | switch self {
|
54 | 54 | case .build:
|
55 | 55 | return "Build Swift packages"
|
56 | 56 | case .package:
|
57 | 57 | return "Create and work on packages"
|
| 58 | + case .packageRegistry: |
| 59 | + return "Interact with package registry and manage related configuration" |
58 | 60 | case .run:
|
59 | 61 | return "Run a program from a package"
|
60 | 62 | case .test:
|
@@ -133,7 +135,7 @@ struct SwiftHelp: ParsableCommand {
|
133 | 135 | case .subcommand(let subcommand):
|
134 | 136 | // Try to find the subcommand adjacent to the help tool.
|
135 | 137 | // If we didn't find the tool there, let the OS search for it.
|
136 |
| - let execName = "swift-\(subcommand)" |
| 138 | + let execName = "swift-\(subcommand.rawValue)" |
137 | 139 | let subcommandPath = Process.findExecutable(
|
138 | 140 | CommandLine.arguments[0])?
|
139 | 141 | .parentDirectory
|
|
0 commit comments