diff --git a/Sources/getHandler.swift b/Sources/getHandler.swift index b32fb64..bb02a27 100644 --- a/Sources/getHandler.swift +++ b/Sources/getHandler.swift @@ -89,7 +89,9 @@ class ReadCommand: OptionCommand { break } - - if (nil != handler) { print(handler!) } else { throw CLIError.error(("An incompatible combination was used, or no application is registered to handle \(self.contentType!)")) } + let arg: String + if (self.contentType != nil) { arg = self.contentType! } + else { arg = "" } + if (nil != handler) { print(handler!) } else { throw CLIError.error(("An incompatible combination was used, or no application is registered to handle \(arg)")) } } }