diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-02-06 18:30:35 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-02-06 18:30:35 -0500 |
commit | b995bfe84f9766e23ff78d7ccd520ec7d8cdbebc (patch) | |
tree | 3e7f15ac3b0abe417797ec89275aa1209f6ca297 /haddock-api/src/Haddock/Options.hs | |
parent | 9f597b6647a53624eaf501a34bfb4d8d15425929 (diff) | |
parent | 010f0320dff64e3f86091ba4691bc69ce6999647 (diff) |
Merge branch 'wip/ghc-head-merge' into ghc-head
Diffstat (limited to 'haddock-api/src/Haddock/Options.hs')
-rw-r--r-- | haddock-api/src/Haddock/Options.hs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs index 04189b99..4d22505f 100644 --- a/haddock-api/src/Haddock/Options.hs +++ b/haddock-api/src/Haddock/Options.hs @@ -37,14 +37,14 @@ module Haddock.Options ( readIfaceArgs, optPackageName, optPackageVersion, - modulePackageInfo + modulePackageInfo, + ignoredSymbols ) where import qualified Data.Char as Char import Data.Version import Control.Applicative -import Distribution.Verbosity import GHC.Data.FastString import GHC ( Module, moduleUnit ) import GHC.Unit.State @@ -110,6 +110,7 @@ data Flag | Flag_PackageVersion String | Flag_Reexport String | Flag_SinceQualification String + | Flag_IgnoreLinkSymbol String | Flag_ParCount (Maybe Int) deriving (Eq, Show) @@ -223,6 +224,8 @@ options backwardsCompat = "version of the package being documented in usual x.y.z.w format", Option [] ["since-qual"] (ReqArg Flag_SinceQualification "QUAL") "package qualification of @since, one of\n'always' (default) or 'only-external'", + Option [] ["ignore-link-symbol"] (ReqArg Flag_IgnoreLinkSymbol "SYMBOL") + "name of a symbol which does not trigger a warning in case of link issue", Option ['j'] [] (OptArg (\count -> Flag_ParCount (fmap read count)) "n") "load modules in parallel" ] @@ -337,11 +340,13 @@ sinceQualification flags = verbosity :: [Flag] -> Verbosity verbosity flags = case [ str | Flag_Verbosity str <- flags ] of - [] -> normal + [] -> Normal x:_ -> case parseVerbosity x of Left e -> throwE e Right v -> v +ignoredSymbols :: [Flag] -> [String] +ignoredSymbols flags = [ symbol | Flag_IgnoreLinkSymbol symbol <- flags ] ghcFlags :: [Flag] -> [String] ghcFlags flags = [ option | Flag_OptGhc option <- flags ] |