haddockAction :: HaddockFlags -> [String] -> GlobalFlags -> IO ()
haddockAction haddockFlags extraArgs globalFlags = do
  let verbosity = fromFlag (haddockVerbosity haddockFlags)
  (_useSandbox, config) <- loadConfigOrSandboxConfig verbosity globalFlags mempty
  let haddockFlags' = defaultHaddockFlags      `mappend`
                      savedHaddockFlags config `mappend` haddockFlags
      setupScriptOptions = defaultSetupScriptOptions {
        useDistPref = fromFlagOrDefault
                      (useDistPref defaultSetupScriptOptions)
                      (haddockDistPref haddockFlags')
        }
  setupWrapper verbosity setupScriptOptions Nothing
    haddockCommand (const haddockFlags') extraArgs
haddockAction :: HaddockFlags -> [String] -> GlobalFlags -> IO ()
haddockAction haddockFlags extraArgs globalFlags = do
  let verbosity = fromFlag (haddockVerbosity haddockFlags)
  (_useSandbox, config) <- loadConfigOrSandboxConfig verbosity globalFlags mempty
  let haddockFlags' = defaultHaddockFlags      `mappend`
                      savedHaddockFlags config `mappend` haddockFlags
      setupScriptOptions = defaultSetupScriptOptions {
        useDistPref = fromFlagOrDefault
                      (useDistPref defaultSetupScriptOptions)
                      (haddockDistPref haddockFlags')
        }
  setupWrapper verbosity setupScriptOptions Nothing
    haddockCommand (const haddockFlags') extraArgs
haddockAction haddockFlags extraArgs globalFlags = do
  let verbosity = fromFlag (haddockVerbosity haddockFlags)
  (_useSandbox, config) <- loadConfigOrSandboxConfig verbosity globalFlags mempty
  let haddockFlags' = defaultHaddockFlags      `mappend`
                      savedHaddockFlags config `mappend` haddockFlags
      setupScriptOptions = defaultSetupScriptOptions {
        useDistPref = fromFlagOrDefault
                      (useDistPref defaultSetupScriptOptions)
                      (haddockDistPref haddockFlags')
        }
  setupWrapper verbosity setupScriptOptions Nothing
    haddockCommand (const haddockFlags') extraArgs