@@ -27,6 +27,7 @@ data DynOpts = DynOpts
2727 { optPhase :: Phase
2828 , optPreserveIt :: PreserveIt
2929 , optStripComs :: StripComments
30+ , optStripEOL :: StripEOL
3031 , optExts :: [String ]
3132 , optTimeout :: Double
3233 , optTimeoutMsg :: String -- ^ timeout response
@@ -45,6 +46,7 @@ defaultDynOpts = DynOpts
4546 { optPhase = Phase2
4647 , optPreserveIt = DontPreserveIt
4748 , optStripComs = DontStripComments
49+ , optStripEOL = DontStripEOL
4850 , optExts = []
4951 , optTimeout = 3
5052 , optTimeoutMsg = " * Hangs forever *"
@@ -62,6 +64,7 @@ newtype Verbosity = Verbosity Int deriving (Eq, Ord, Show)
6264data PreserveIt = PreserveIt | DontPreserveIt deriving (Eq , Show )
6365data CabalPlan = CabalPlan | NoCabalPlan deriving (Eq , Show )
6466data StripComments = StripComments | DontStripComments deriving (Eq , Show )
67+ data StripEOL = StripEOL | DontStripEOL deriving (Eq , Show )
6568
6669data Properties
6770 = SkipProperties
@@ -145,6 +148,7 @@ dynOptsP = pure combine
145148 <*> phaseP
146149 <*> preserveItP
147150 <*> stripComsP
151+ <*> stripEolP
148152 <*> listP extP
149153 <*> timeoutP
150154 <*> timeoutMsgP
@@ -166,8 +170,8 @@ dynOptsP = pure combine
166170 monoidP :: Monoid a => O. Parser a -> O. Parser (a -> a )
167171 monoidP p = (\ xs ys -> mconcat (ys : xs)) <$> many p
168172
169- combine f1 f2 f3 f4 f5 f6 f7 f8 f9 fA fB fC fD fE (DynOpts x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE) =
170- DynOpts (f1 x1) (f2 x2) (f3 x3) (f4 x4) (f5 x5) (f6 x6) (f7 x7) (f8 x8) (f9 x9) (fA xA) (fB xB) (fC xC) (fD xD) (fE xE)
173+ combine f1 f2 f3 f4 f5 f6 f7 f8 f9 fA fB fC fD fE fG (DynOpts x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xG ) =
174+ DynOpts (f1 x1) (f2 x2) (f3 x3) (f4 x4) (f5 x5) (f6 x6) (f7 x7) (f8 x8) (f9 x9) (fA xA) (fB xB) (fC xC) (fD xD) (fE xE) (fG xG)
171175
172176lastOpt :: [a ] -> a -> a
173177lastOpt xs initial = foldl' (\ _ x -> x) initial xs
@@ -195,6 +199,18 @@ stripComsP = lastOpt <$> many (on <|> off) where
195199 on = O. flag' StripComments $ O. long " strip-comments" <> O. help " Strip comments in examples"
196200 off = O. flag' DontStripComments $ O. long " no-strip-comments" <> O. help " Don't strip comments in examples"
197201
202+ -- $ diff --help
203+ -- <...>
204+ -- -E, --ignore-tab-expansion ignore changes due to tab expansion
205+ -- -Z, --ignore-trailing-space ignore white space at line end
206+ -- -b, --ignore-space-change ignore changes in the amount of white space
207+ -- -w, --ignore-all-space ignore all white space
208+ -- -B, --ignore-blank-lines ignore changes where lines are all blank
209+ stripEolP :: O. Parser (StripEOL -> StripEOL )
210+ stripEolP = lastOpt <$> many (on <|> off) where
211+ on = O. flag' StripEOL $ O. short ' Z' <> O. long " ignore-trailing-space" <> O. help " Ignore white space at line end"
212+ off = O. flag' DontStripEOL $ O. long " no-ignore-trailing-space" <> O. help " Don't ingore white space at line end"
213+
198214propertiesP :: O. Parser (Properties -> Properties )
199215propertiesP = lastOpt <$> many (skip <|> simple) where
200216 skip = O. flag' SkipProperties $ O. long " no-check-properties" <> O. help " Skip properties (default)"
0 commit comments