This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree 5 files changed +17
-6
lines changed
Sources/swift-doc/Subcommands 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
32
32
- Changed serialization of ` Symbol ` to encode and decode ` sourceRange ` key
33
33
instead of ` sourceLocation ` key.
34
34
#237 by @mattt .
35
+ - Changed commands to warn when invalid paths are passed.
36
+ #242 by @Lukas-Stuehrk .
35
37
36
38
### Deprecated
37
39
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ $ apt-get install -y libxml2-dev graphviz
92
92
USAGE: swift doc generate [<inputs> ...] --module-name <module-name> [--output <output>] [--format <format>] [--base-url <base-url>]
93
93
94
94
ARGUMENTS:
95
- <inputs> One or more paths to Swift files
95
+ <inputs> One or more paths to a directory containing Swift files.
96
96
97
97
OPTIONS:
98
98
-n, --module-name <module-name>
@@ -150,7 +150,7 @@ pass the `--minimum-access-level` flag with the specified access level.
150
150
USAGE: swift doc coverage [<inputs> ...] [--output <output>]
151
151
152
152
ARGUMENTS:
153
- <inputs> One or more paths to Swift files
153
+ <inputs> One or more paths to a directory containing Swift files.
154
154
155
155
OPTIONS:
156
156
-o, --output <output> The path for generated report
@@ -202,7 +202,7 @@ please reach out by [opening an Issue][open an issue]!
202
202
USAGE: swift doc diagram [<inputs> ...]
203
203
204
204
ARGUMENTS:
205
- <inputs> One or more paths to Swift files
205
+ <inputs> One or more paths to a directory containing Swift files.
206
206
207
207
OPTIONS:
208
208
--minimum-access-level <minimum-access-level>
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import SwiftDoc
6
6
extension SwiftDoc {
7
7
struct Coverage : ParsableCommand {
8
8
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. " )
10
10
var inputs : [ String ]
11
11
12
12
@Option ( name: . shortAndLong,
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import GraphViz
7
7
extension SwiftDoc {
8
8
struct Diagram : ParsableCommand {
9
9
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. " )
11
11
var inputs : [ String ]
12
12
13
13
@Option ( name: . long,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ extension SwiftDoc {
17
17
}
18
18
19
19
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. " )
21
21
var inputs : [ String ]
22
22
23
23
@Option ( name: [ . long, . customShort( " n " ) ] ,
@@ -47,6 +47,15 @@ extension SwiftDoc {
47
47
var options : Options
48
48
49
49
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
+
50
59
let module = try Module ( name: options. moduleName, paths: options. inputs)
51
60
let baseURL = options. baseURL
52
61
You can’t perform that action at this time.
0 commit comments