age_flags :: [Flag (CmdLineP DynFlags)]
package_flags = [
        ------- Packages ----------------------------------------------------
    Flag "package-db"            (HasArg (addPkgConfRef . PkgConfFile))
  , Flag "clear-package-db"      (NoArg clearPkgConf)
  , Flag "no-global-package-db"  (NoArg removeGlobalPkgConf)
  , Flag "no-user-package-db"    (NoArg removeUserPkgConf)
  , Flag "global-package-db"     (NoArg (addPkgConfRef GlobalPkgConf))
  , Flag "user-package-db"       (NoArg (addPkgConfRef UserPkgConf))

    -- backwards compat with GHC<=7.4 :
  , Flag "package-conf"          (HasArg $ \path -> do
                                    addPkgConfRef (PkgConfFile path)
                                    deprecate "Use -package-db instead")
  , Flag "no-user-package-conf"  (NoArg $ do
                                    removeUserPkgConf
                                    deprecate "Use -no-user-package-db instead")

  , Flag "package-name"          (hasArg setPackageName)
  , Flag "package-id"            (HasArg exposePackageId)
  , Flag "package"               (HasArg exposePackage)
  , Flag "hide-package"          (HasArg hidePackage)
  , Flag "hide-all-packages"     (NoArg (setGeneralFlag Opt_HideAllPackages))
  , Flag "ignore-package"        (HasArg ignorePackage)
  , Flag "syslib"                (HasArg (\s -> do exposePackage s
                                                   deprecate "Use -package instead"))
  , Flag "distrust-all-packages" (NoArg (setGeneralFlag Opt_DistrustAllPackages))
  , Flag "trust"                 (HasArg trustPackage)
  , Flag "distrust"              (HasArg distrustPackage)
  ]

ty
package_flags :: [Flag (CmdLineP DynFlags)]
package_flags = [
        ------- Packages ----------------------------------------------------
    Flag "package-db"            (HasArg (addPkgConfRef . PkgConfFile))
  , Flag "clear-package-db"      (NoArg clearPkgConf)
  , Flag "no-global-package-db"  (NoArg removeGlobalPkgConf)
  , Flag "no-user-package-db"    (NoArg removeUserPkgConf)
  , Flag "global-package-db"     (NoArg (addPkgConfRef GlobalPkgConf))
  , Flag "user-package-db"       (NoArg (addPkgConfRef UserPkgConf))

    -- backwards compat with GHC<=7.4 :
  , Flag "package-conf"          (HasArg $ \path -> do
                                    addPkgConfRef (PkgConfFile path)
                                    deprecate "Use -package-db instead")
  , Flag "no-user-package-conf"  (NoArg $ do
                                    removeUserPkgConf
                                    deprecate "Use -no-user-package-db instead")

  , Flag "package-name"          (hasArg setPackageName)
  , Flag "package-id"            (HasArg exposePackageId)
  , Flag "package"               (HasArg exposePackage)
  , Flag "hide-package"          (HasArg hidePackage)
  , Flag "hide-all-packages"     (NoArg (setGeneralFlag Opt_HideAllPackages))
  , Flag "ignore-package"        (HasArg ignorePackage)
  , Flag "syslib"                (HasArg (\s -> do exposePackage s
                                                   deprecate "Use -package instead"))
  , Flag "distrust-all-packages" (NoArg (setGeneralFlag Opt_DistrustAllPackages))
  , Flag "trust"                 (HasArg trustPackage)
  , Flag "distrust"              (HasArg distrustPackage)
  ]
package_flags = [
        ------- Packages ----------------------------------------------------
    Flag "package-db"            (HasArg (addPkgConfRef . PkgConfFile))
  , Flag "clear-package-db"      (NoArg clearPkgConf)
  , Flag "no-global-package-db"  (NoArg removeGlobalPkgConf)
  , Flag "no-user-package-db"    (NoArg removeUserPkgConf)
  , Flag "global-package-db"     (NoArg (addPkgConfRef GlobalPkgConf))
  , Flag "user-package-db"       (NoArg (addPkgConfRef UserPkgConf))

    -- backwards compat with GHC<=7.4 :
  , Flag "package-conf"          (HasArg $ \path -> do
                                    addPkgConfRef (PkgConfFile path)
                                    deprecate "Use -package-db instead")
  , Flag "no-user-package-conf"  (NoArg $ do
                                    removeUserPkgConf
                                    deprecate "Use -no-user-package-db instead")

  , Flag "package-name"          (hasArg setPackageName)
  , Flag "package-id"            (HasArg exposePackageId)
  , Flag "package"               (HasArg exposePackage)
  , Flag "hide-package"          (HasArg hidePackage)
  , Flag "hide-all-packages"     (NoArg (setGeneralFlag Opt_HideAllPackages))
  , Flag "ignore-package"        (HasArg ignorePackage)
  , Flag "syslib"                (HasArg (\s -> do exposePackage s
                                                   deprecate "Use -package instead"))
  , Flag "distrust-all-packages" (NoArg (setGeneralFlag Opt_DistrustAllPackages))
  , Flag "trust"                 (HasArg trustPackage)
  , Flag "distrust"              (HasArg distrustPackage)
  ]