1 {-# LANGUAGE DeriveGeneric #-}
2 {-# LANGUAGE LambdaCase #-}
4 module Distribution
.Client
.ManpageFlags
10 import Distribution
.Client
.Compat
.Prelude
12 import Distribution
.Simple
.Command
(OptionField
(..), ShowOrParseArgs
(..), option
)
13 import Distribution
.Simple
.Setup
(Flag
(..), optionVerbosity
, toFlag
, trueArg
)
14 import Distribution
.Verbosity
(normal
)
16 data ManpageFlags
= ManpageFlags
17 { manpageVerbosity
:: Flag Verbosity
18 , manpageRaw
:: Flag
Bool
20 deriving (Eq
, Show, Generic
)
22 instance Monoid ManpageFlags
where
26 instance Semigroup ManpageFlags
where
29 defaultManpageFlags
:: ManpageFlags
32 { manpageVerbosity
= toFlag normal
33 , manpageRaw
= toFlag
False
36 manpageOptions
:: ShowOrParseArgs
-> [OptionField ManpageFlags
]
38 [ optionVerbosity manpageVerbosity
(\v flags
-> flags
{manpageVerbosity
= v
})
42 "Output raw troff content"
44 (\v flags
-> flags
{manpageRaw
= v
})