           moduleMapPath = pair.value
         }
       case "Visibility":
-        if let value = Visibility(rawValue: pair.value) {
+        if let value = Visibility(flag: pair.value) {
           visibility = value
         } else {
           throw GenerationError.invalidParameterValue(name: pair.key,

import SwiftProtobufPluginLibrary

class GeneratorOptions {
  enum OutputNaming : String {
    case fullPath = "FullPath"
    case pathToUnderscores = "PathToUnderscores"
    case dropPath = "DropPath"
  }

  enum Visibility : String {
    case `internal` = "Internal"
    case `public` = "Public"
  }

  let outputNaming: OutputNaming

    for pair in parseParameter(string:parameter) {
      switch pair.key {
      case "FileNaming":
        if let naming = OutputNaming(flag: pair.value) {
          outputNaming = naming
        } else {
          throw GenerationError.invalidParameterValue(name: pair.key,
