Skip to content

Commit 1e40127

Browse files
committed
[swift-test] Parse specifer in swift-test
1 parent 22954af commit 1e40127

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Sources/swift-test/usage.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ func usage(_ print: (String) -> Void = { print($0) }) {
1818
print("USAGE: swift test [specifier] [options]")
1919
print("")
2020
print("SPECIFIER:")
21-
print(" TestModule.TestCase Run a test case subclass")
22-
print(" TestModule.TestCase/test1 Run a specific test method")
21+
print(" -s TestModule.TestCase Run a test case subclass")
22+
print(" -s TestModule.TestCase/test1 Run a specific test method")
2323
print("")
2424
print("OPTIONS:")
2525
print(" --chdir Change working directory before any other operation [-C]")
@@ -34,6 +34,9 @@ enum Mode: Argument, Equatable, CustomStringConvertible {
3434
switch argument {
3535
case "--help", "--usage", "-h":
3636
self = .Usage
37+
case "-s":
38+
guard let specifier = pop() else { throw OptionsParser.Error.ExpectedAssociatedValue(argument) }
39+
self = .Run(specifier)
3740
default:
3841
return nil
3942
}

0 commit comments

Comments
 (0)