Skip to content

Commit e50332a

Browse files
authored
Merge pull request #1208 from yim-lee/help-registry
Add package-registry subcommand to swift help
2 parents bbcc224 + aa98932 commit e50332a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Sources/swift-help/main.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2020 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020-2022 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -47,14 +47,16 @@ enum HelpTopic: ExpressibleByArgument, CustomStringConvertible {
4747
}
4848

4949
enum Subcommand: String, CaseIterable {
50-
case build, package, run, test
50+
case build, package, packageRegistry = "package-registry", run, test
5151

5252
var description: String {
5353
switch self {
5454
case .build:
5555
return "Build Swift packages"
5656
case .package:
5757
return "Create and work on packages"
58+
case .packageRegistry:
59+
return "Interact with package registry and manage related configuration"
5860
case .run:
5961
return "Run a program from a package"
6062
case .test:
@@ -133,7 +135,7 @@ struct SwiftHelp: ParsableCommand {
133135
case .subcommand(let subcommand):
134136
// Try to find the subcommand adjacent to the help tool.
135137
// 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)"
137139
let subcommandPath = Process.findExecutable(
138140
CommandLine.arguments[0])?
139141
.parentDirectory

0 commit comments

Comments
 (0)