File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,12 @@ struct SwiftJava: AsyncParsableCommand {
186186 }
187187
188188 mutating func run( ) async {
189+ guard CommandLine . arguments. count > 1 else {
190+ // there's no "default" command, print USAGE when no arguments/parameters are passed.
191+ print ( " Must specify run mode. \n \( Self . helpMessage ( ) ) " )
192+ return
193+ }
194+
189195 print ( " [info][swift-java] Run: \( CommandLine . arguments. joined ( separator: " " ) ) " )
190196 print ( " [info][swift-java] Current work directory: \( URL ( fileURLWithPath: " . " ) ) " )
191197 print ( " [info][swift-java] Module base directory: \( moduleBaseDir) " )
@@ -230,7 +236,7 @@ struct SwiftJava: AsyncParsableCommand {
230236 toolMode = . configuration( extraClasspath: input)
231237 } else if fetch {
232238 guard let input else {
233- fatalError ( " Mode -jar requires <input> path \n \( Self . helpMessage ( ) ) " )
239+ fatalError ( " Mode 'fetch' requires <input> path \n \( Self . helpMessage ( ) ) " )
234240 }
235241 config = try JavaTranslator . readConfiguration ( from: URL ( fileURLWithPath: input) )
236242 guard let dependencies = config. dependencies else {
You can’t perform that action at this time.
0 commit comments