Add withReorder function
parent
6a4d15e895
commit
6a45f4b3a6
|
@ -59,6 +59,7 @@ module UI.Butcher.Monadic.Command
|
||||||
, addCmdHelpStr
|
, addCmdHelpStr
|
||||||
, reorderStart
|
, reorderStart
|
||||||
, reorderStop
|
, reorderStop
|
||||||
|
, withReorder
|
||||||
, peekCmdDesc
|
, peekCmdDesc
|
||||||
, peekInput
|
, peekInput
|
||||||
-- * Building CmdParsers - myprog -v --input PATH
|
-- * Building CmdParsers - myprog -v --input PATH
|
||||||
|
|
|
@ -24,6 +24,7 @@ module UI.Butcher.Monadic.Internal.Core
|
||||||
, addCmdImpl
|
, addCmdImpl
|
||||||
, reorderStart
|
, reorderStart
|
||||||
, reorderStop
|
, reorderStop
|
||||||
|
, withReorder
|
||||||
, checkCmdParser
|
, checkCmdParser
|
||||||
, runCmdParser
|
, runCmdParser
|
||||||
, runCmdParserExt
|
, runCmdParserExt
|
||||||
|
@ -245,6 +246,11 @@ reorderStart = liftF $ CmdParserReorderStart ()
|
||||||
reorderStop :: CmdParser f out ()
|
reorderStop :: CmdParser f out ()
|
||||||
reorderStop = liftF $ CmdParserReorderStop ()
|
reorderStop = liftF $ CmdParserReorderStop ()
|
||||||
|
|
||||||
|
-- | Safe wrapper around 'reorderStart'/'reorderStop' for cases where reducing
|
||||||
|
-- to a single binding is possible/preferable.
|
||||||
|
withReorder :: CmdParser f out a -> CmdParser f out a
|
||||||
|
withReorder x = reorderStart *> x <* reorderStop
|
||||||
|
|
||||||
-- addPartHelp :: String -> CmdPartParser ()
|
-- addPartHelp :: String -> CmdPartParser ()
|
||||||
-- addPartHelp s = liftF $ CmdPartParserHelp s ()
|
-- addPartHelp s = liftF $ CmdPartParserHelp s ()
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in New Issue