Skip to content

Commit 034506a

Browse files
authored
Merge pull request swiftlang#94 from SwiftDocOrg/add-version-number
Add swift-doc version number
2 parents 4387e56 + afaed4a commit 034506a

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
#65 by @kean.
1414
- Added asset pipeline for CSS assets.
1515
#49 by @kaishin.
16+
- Add `swift-doc` version number to command and generated output.
17+
#94 by @mattt.
1618

1719
### Changed
1820

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let package = Package(
1818
.package(url: "https://github.com/NSHipster/HypertextLiteral.git", .upToNextMinor(from: "0.0.2")),
1919
.package(url: "https://github.com/SwiftDocOrg/Markup.git", .upToNextMinor(from: "0.0.3")),
2020
.package(url: "https://github.com/NSHipster/SwiftSyntaxHighlighter.git", .revision("1.0.0")),
21-
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.0.2")),
21+
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.0.5")),
2222
.package(url: "https://github.com/apple/swift-log.git", .upToNextMinor(from: "1.2.0")),
2323
.package(url: "https://github.com/NSHipster/swift-log-github-actions.git", .upToNextMinor(from: "0.0.1")),
2424
],

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ $ make install
4646

4747
OVERVIEW: A utility for generating documentation for Swift code.
4848

49-
USAGE: swift-doc <subcommand>
49+
USAGE: swift doc <subcommand>
5050

5151
OPTIONS:
52+
--version Show the version.
5253
-h, --help Show help information.
5354

5455
SUBCOMMANDS:
@@ -67,7 +68,7 @@ $ make install
6768

6869
OVERVIEW: Generates Swift documentation
6970

70-
USAGE: swift-doc generate [<inputs> ...] --module-name <module-name> [--output <output>] [--format <format>]
71+
USAGE: swift doc generate [<inputs> ...] --module-name <module-name> [--output <output>] [--format <format>]
7172

7273
ARGUMENTS:
7374
<inputs> One or more paths to Swift files
@@ -111,7 +112,7 @@ $ Documentation/
111112

112113
OVERVIEW: Generates documentation coverage statistics for Swift files
113114

114-
USAGE: swift-doc coverage [<inputs> ...] [--output <output>]
115+
USAGE: swift doc coverage [<inputs> ...] [--output <output>]
115116

116117
ARGUMENTS:
117118
<inputs> One or more paths to Swift files
@@ -160,7 +161,7 @@ please reach out by [opening an Issue][open an issue]!
160161

161162
OVERVIEW: Generates diagram of Swift symbol relationships
162163

163-
USAGE: swift-doc diagram [<inputs> ...]
164+
USAGE: swift doc diagram [<inputs> ...]
164165

165166
ARGUMENTS:
166167
<inputs> One or more paths to Swift files

Sources/swift-doc/Supporting Types/Pages/FooterPage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct FooterPage: Page {
2525

2626
return Document {
2727
Fragment {
28-
"Generated at \(timestamp) using [swift-doc](\(href))."
28+
"Generated at \(timestamp) using [swift-doc](\(href)) \(SwiftDoc.configuration.version)."
2929
}
3030
}
3131
}
@@ -36,7 +36,7 @@ struct FooterPage: Page {
3636

3737
return #"""
3838
<p>
39-
Generated on <time datetime=\#(timestamp)>\#(dateString)</time> using <a href=\#(href)>swift-doc</a>.
39+
Generated on <time datetime=\#(timestamp)>\#(dateString)</time> using <a href=\#(href)>swift-doc</a> <span class="version">\#(SwiftDoc.configuration.version)</span>.
4040
</p>
4141
"""#
4242
}

Sources/swift-doc/main.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ var standardError = FileHandle.standardError
2121

2222
struct SwiftDoc: ParsableCommand {
2323
static var configuration = CommandConfiguration(
24+
commandName: "swift doc",
2425
abstract: "A utility for generating documentation for Swift code.",
26+
version: "1.0.0-beta.2",
2527
subcommands: [Generate.self, Coverage.self, Diagram.self]
2628
)
2729
}

0 commit comments

Comments
 (0)