  - returns: The Path matching the template to find
  */
 func findTemplate(prefix: String, templateShortName: String, templateFullPath: String) throws -> Path {
-  guard templateFullPath.isEmpty else {
+  switch (templateFullPath, templateShortName) {
+  case ("", ""): throw TemplateError.noTemplateFound
+  case (_, ""):
     let fullPath = Path(templateFullPath)
     guard fullPath.isFile else {
       throw TemplateError.templatePathNotFound(path: fullPath)
     }
     return fullPath
+  case ("", _):
+    var path = appSupportTemplatesPath + "\(prefix)-\(templateShortName).stencil"
+    if !path.isFile {
+      path = bundledTemplatesPath + "\(prefix)-\(templateShortName).stencil"
+    }
+    guard path.isFile else {
+      throw TemplateError.namedTemplateNotFound(name: templateShortName)
+    }
+    return path
+  case (_, _):
+    throw TemplateError.multipleTemplateOptions(path: templateFullPath, name: templateShortName)
   }
-
-  var path = appSupportTemplatesPath + "\(prefix)-\(templateShortName).stencil"
-  if !path.isFile {
-    path = bundledTemplatesPath + "\(prefix)-\(templateShortName).stencil"
-  }
-  guard path.isFile else {
-    throw TemplateError.namedTemplateNotFound(name: templateShortName)
-  }
-  return path
 }

enum TemplateError: Error, CustomStringConvertible {
  case namedTemplateNotFound(name: String)
  case templatePathNotFound(path: Path)
  case deprecated(option: String, replacement: String)

  var description: String {

      "or use --templatePath to specify a template by its full path."
    case .templatePathNotFound(let path):
      return "Template not found at path \(path.description)."
    case .noTemplateFound:
      return "A template must be chosen either via its name using the '-t' / '--template' option" +
      " or via its path using the '-p' / '--templatePath' option.\n" +
      "There's no 'default' template anymore: you can still access a bundled template but " +
      "you have to explicitly specify its name using '-t'.\n" +
      "To list all the available named templates, you can use the 'swiftgen templates list' command."
    case let .multipleTemplateOptions(path, name):
      return "You need to choose EITHER a named template (--template option) " +
      "OR a template path (option --templatePath). Found name '\(name)' and path '\(path)'"
    case .deprecated(let option, let replacement):
      return "The option '--\(option)' has been deprecated. \(replacement)"
    }
