Skip to content

Commit af66fdc

Browse files
authored
Merge pull request #649 from allevato/version-number
Some minor frontend tweaks.
2 parents 29b5199 + 84d63b7 commit af66fdc

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
func printVersionInformation() {
14+
// TODO: Automate updates to this somehow.
15+
print("main")
16+
}

Sources/swift-format/main.swift renamed to Sources/swift-format/SwiftFormatCommand.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import ArgumentParser
1414

1515
/// Collects the command line options that were passed to `swift-format` and dispatches to the
1616
/// appropriate subcommand.
17+
@main
1718
struct SwiftFormatCommand: ParsableCommand {
1819
static var configuration = CommandConfiguration(
1920
commandName: "swift-format",
@@ -29,5 +30,3 @@ struct SwiftFormatCommand: ParsableCommand {
2930
@OptionGroup()
3031
var versionOptions: VersionOptions
3132
}
32-
33-
SwiftFormatCommand.main()

Sources/swift-format/VersionOptions.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ struct VersionOptions: ParsableArguments {
1919

2020
func validate() throws {
2121
if version {
22-
// TODO: Automate updates to this somehow.
23-
print("508.0.0")
22+
printVersionInformation()
2423
throw ExitCode.success
2524
}
2625
}

0 commit comments

Comments
 (0)