structured-cli 2.2.1.0 → 2.3.0.0
raw patch · 2 files changed
+7/−7 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- System.Console.StructuredCLI: Settings :: Maybe FilePath -> String -> String -> Bool -> ExceptionHandler m -> Settings m
+ System.Console.StructuredCLI: Settings :: Maybe FilePath -> String -> m String -> Bool -> ExceptionHandler m -> Settings m
- System.Console.StructuredCLI: [getPrompt] :: Settings m -> String
+ System.Console.StructuredCLI: [getPrompt] :: Settings m -> m String
Files
src/System/Console/StructuredCLI.hs view
@@ -208,7 +208,7 @@ -- | Text to display upon start of the CLI application getBanner :: String, -- | Prompt characters to display to the right of the current command "stack"- getPrompt :: String,+ getPrompt :: m String, -- | Disable prompt for use with batch scripts isBatch :: Bool, -- | Exception handler@@ -262,7 +262,7 @@ liftIO = lift . liftIO instance (MonadIO m) => Default (Settings m) where- def = Settings Nothing "" " > " False defExceptionHandler+ def = Settings Nothing "" (return " > ") False defExceptionHandler instance (Monad m) => Default (Parser m) where def = labelParser@@ -507,7 +507,7 @@ runLevel :: (?settings::Settings m, MonadException m) => ParserT m () runLevel = do- prompt <- buildPrompt <$> withLabels+ prompt <- liftUserM . buildPrompt =<< withLabels stack0 <- getStack result <- runMaybeT $ do line <- MaybeT . liftInputT $ HL.getInputLine prompt@@ -520,9 +520,9 @@ _ -> return () - where buildPrompt ns = (intercalate " " . reverse $ ns) ++ getPrompt ?settings- withLabels = getStack >>= return . fmap fst- restore stack = liftStateM . modify $ \s -> s { stack = stack }+ where buildPrompt ns = intercalate " " . (: reverse ns) <$> getPrompt ?settings+ withLabels = fmap fst <$> getStack+ restore stack = liftStateM . modify $ \s -> s { stack = stack } getStack :: (Monad m) => ParserT m [Level m] getStack = liftStateM $ gets stack
structured-cli.cabal view
@@ -1,5 +1,5 @@ name: structured-cli-version: 2.2.1.0+version: 2.3.0.0 synopsis: Application library for building interactive console CLIs description: This module provides the tools to build a complete "structured" CLI application, similar to those found in systems like Cisco IOS or console configuration utilities etc. It aims to be easy for implementors to use. homepage: https://gitlab.com/codemonkeylabs/structured-cli#readme