This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +17
-6
lines changed
Sources/swift-doc/Subcommands Expand file tree Collapse file tree 5 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3232- Changed serialization of ` Symbol ` to encode and decode ` sourceRange ` key
3333 instead of ` sourceLocation ` key.
3434 #237 by @mattt .
35+ - Changed commands to warn when invalid paths are passed.
36+ #242 by @Lukas-Stuehrk .
3537
3638### Deprecated
3739
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ $ apt-get install -y libxml2-dev graphviz
9292 USAGE: swift doc generate [<inputs> ...] --module-name <module-name> [--output <output>] [--format <format>] [--base-url <base-url>]
9393
9494 ARGUMENTS:
95- <inputs> One or more paths to Swift files
95+ <inputs> One or more paths to a directory containing Swift files.
9696
9797 OPTIONS:
9898 -n, --module-name <module-name>
@@ -150,7 +150,7 @@ pass the `--minimum-access-level` flag with the specified access level.
150150 USAGE: swift doc coverage [<inputs> ...] [--output <output>]
151151
152152 ARGUMENTS:
153- <inputs> One or more paths to Swift files
153+ <inputs> One or more paths to a directory containing Swift files.
154154
155155 OPTIONS:
156156 -o, --output <output> The path for generated report
@@ -202,7 +202,7 @@ please reach out by [opening an Issue][open an issue]!
202202 USAGE: swift doc diagram [<inputs> ...]
203203
204204 ARGUMENTS:
205- <inputs> One or more paths to Swift files
205+ <inputs> One or more paths to a directory containing Swift files.
206206
207207 OPTIONS:
208208 --minimum-access-level <minimum-access-level>
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import SwiftDoc
66extension SwiftDoc {
77 struct Coverage : ParsableCommand {
88 struct Options : ParsableArguments {
9- @Argument ( help: " One or more paths to Swift files " )
9+ @Argument ( help: " One or more paths to a directory containing Swift files. " )
1010 var inputs : [ String ]
1111
1212 @Option ( name: . shortAndLong,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import GraphViz
77extension SwiftDoc {
88 struct Diagram : ParsableCommand {
99 struct Options : ParsableArguments {
10- @Argument ( help: " One or more paths to Swift files " )
10+ @Argument ( help: " One or more paths to a directory containing Swift files. " )
1111 var inputs : [ String ]
1212
1313 @Option ( name: . long,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ extension SwiftDoc {
1717 }
1818
1919 struct Options : ParsableArguments {
20- @Argument ( help: " One or more paths to Swift files " )
20+ @Argument ( help: " One or more paths to a directory containing Swift files. " )
2121 var inputs : [ String ]
2222
2323 @Option ( name: [ . long, . customShort( " n " ) ] ,
@@ -47,6 +47,15 @@ extension SwiftDoc {
4747 var options : Options
4848
4949 func run( ) throws {
50+ for directory in options. inputs {
51+ var isDirectory : ObjCBool = false
52+ if !FileManager. default. fileExists ( atPath: directory, isDirectory: & isDirectory) {
53+ logger. warning ( " Input path \( directory) does not exist. " )
54+ } else if !isDirectory. boolValue {
55+ logger. warning ( " Input path \( directory) is not a directory. " )
56+ }
57+ }
58+
5059 let module = try Module ( name: options. moduleName, paths: options. inputs)
5160 let baseURL = options. baseURL
5261
You can’t perform that action at this time.
0 commit comments