optionFields :: [Option] -> [C.Initializer]
optionFields = zipWith field [(1::Int)..]
  where field i option =
          [C.cinit| { $string:(optionLongName option), $id:arg, NULL, $int:i } |]
          where arg = case optionArgument option of
                        NoArgument       -> "no_argument"
                        RequiredArgument -> "required_argument"
                        OptionalArgument -> "optional_argument"
optionFields :: [Option] -> [C.Initializer]
optionFields = zipWith field [(1::Int)..]
  where field i option =
          [C.cinit| { $string:(optionLongName option), $id:arg, NULL, $int:i } |]
          where arg = case optionArgument option of
                        NoArgument       -> "no_argument"
                        RequiredArgument -> "required_argument"
                        OptionalArgument -> "optional_argument"
optionFields = zipWith field [(1::Int)..]
  where field i option =
          [C.cinit| { $string:(optionLongName option), $id:arg, NULL, $int:i } |]
          where arg = case optionArgument option of
                        NoArgument       -> "no_argument"
                        RequiredArgument -> "required_argument"
                        OptionalArgument -> "optional_argument"