packages feed

cli-extras 0.1.0.0 → 0.1.0.1

raw patch · 8 files changed

+81/−68 lines, 8 filesdep +monad-loggerdep ~basedep ~lensdep ~timenew-uploaderPVP ok

version bump matches the API change (PVP)

Dependencies added: monad-logger

Dependency ranges changed: base, lens, time, which

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,4 +1,9 @@ # Revision history for cli-extras +## 0.1.0.1++* Loosen version bounds. Support GHC 8.8.4.+* Remove orphan MonadFail instance for LoggingT (we now require monad-logger >= 0.3.30)+ ## 0.1.0.0 * Initial release
+ README.md view
@@ -0,0 +1,10 @@+cli-extras+==========+[![Haskell](https://img.shields.io/badge/language-Haskell-orange.svg)](https://haskell.org) [![Hackage](https://img.shields.io/hackage/v/cli-extras.svg)](https://hackage.haskell.org/package/cli-extras) [![Hackage CI](https://matrix.hackage.haskell.org/api/v2/packages/cli-extras/badge)](https://matrix.hackage.haskell.org/#/package/cli-extras) [![Github CI](https://github.com/obsidiansystems/cli-extras/workflows/github-action/badge.svg)](https://github.com/obsidiansystems/cli-extras/actions) [![BSD3 License](https://img.shields.io/badge/license-BSD3-blue.svg)](https://github.com/obsidiansystems/cli-extras/blob/master/LICENSE)+++This library collects several utilities that are helpful when building command line interface applications.++It provides facilities for logging, formatted printing to the terminal, spinners, and theming.++For an example of this library in action, have a look at [cli-git](https://github.com/obsidiansystems/cli-git).
cli-extras.cabal view
@@ -1,55 +1,63 @@-cabal-version: >=1.10-name: cli-extras-version: 0.1.0.0-license: BSD3-license-file: LICENSE-copyright: Obsidian Systems LLC 2020-maintainer: maintainer@obsidian.systems-author: Obsidian Systems LLC-stability: Unstable-bug-reports: https://github.com/obsidiansystems/cli-extras/issues-synopsis: Miscellaneous utilities for building and working with command line interfaces+cabal-version:      >=1.10+name:               cli-extras+version:            0.1.0.1+license:            BSD3+license-file:       LICENSE+copyright:          Obsidian Systems LLC 2020+maintainer:         maintainer@obsidian.systems+author:             Obsidian Systems LLC+stability:          Unstable+bug-reports:        https://github.com/obsidiansystems/cli-extras/issues+synopsis:+  Miscellaneous utilities for building and working with command line interfaces+ description:-    This library was created to hold code that is shared among multiple command line apps.-category: Command Line-build-type: Simple-extra-source-files:-    CHANGELOG.md+  Convenience functions for writing command line interfaces, providing facilities for logging, process management, and printing to the terminal. -source-repository head-    type: git-    location: https://github.com/obsidiansystems/cli-extras+category:           Command Line+build-type:         Simple+extra-source-files: CHANGELOG.md+                    README.md +tested-with: GHC ==8.6.5 || ==8.8.4+ library-    exposed-modules:-        Bindings.Cli.Coreutils-        Cli.Extras-        Cli.Extras.SubExcept-    hs-source-dirs: src-    other-modules:-        Cli.Extras.Logging-        Cli.Extras.Process-        Cli.Extras.Spinner-        Cli.Extras.TerminalString-        Cli.Extras.Theme-        Cli.Extras.Types-    default-language: Haskell2010-    ghc-options: -Wall -fobject-code-    build-depends:-        aeson >=1.4.4.0 && <1.5,-        ansi-terminal >=0.9.1 && <0.10,-        base >=4.12.0.0 && <4.13,-        bytestring >=0.10.8.2 && <0.11,-        containers >=0.6.0.1 && <0.7,-        exceptions >=0.10.3 && <0.11,-        io-streams >=1.5.1.0 && <1.6,-        lens >=4.17.1 && <4.18,-        logging-effect >=1.3.4 && <1.4,-        monad-loops >=0.4.3 && <0.5,-        mtl >=2.2.2 && <2.3,-        process >=1.6.5.0 && <1.7,-        terminal-size >=0.3.2.1 && <0.4,-        text >=1.2.3.1 && <1.3,-        time >=1.8.0.2 && <1.9,-        transformers >=0.5.6.2 && <0.6,-        which >=0.1.0.0 && <0.2+  exposed-modules:+    Bindings.Cli.Coreutils+    Cli.Extras+    Cli.Extras.SubExcept++  hs-source-dirs:   src+  other-modules:+    Cli.Extras.Logging+    Cli.Extras.Process+    Cli.Extras.Spinner+    Cli.Extras.TerminalString+    Cli.Extras.Theme+    Cli.Extras.Types++  default-language: Haskell2010+  ghc-options:      -Wall -fobject-code+  build-depends:+      aeson           >=1.4.4.0  && <1.5+    , ansi-terminal   >=0.9.1    && <0.10+    , base            >=4.12.0.0 && <4.15+    , bytestring      >=0.10.8.2 && <0.11+    , containers      >=0.6.0.1  && <0.7+    , exceptions      >=0.10.3   && <0.11+    , io-streams      >=1.5.1.0  && <1.6+    , lens            >=4.17.1   && <4.20+    , logging-effect  >=1.3.4    && <1.4+    , monad-logger    >=0.3.30   && <0.4+    , monad-loops     >=0.4.3    && <0.5+    , mtl             >=2.2.2    && <2.3+    , process         >=1.6.5.0  && <1.7+    , terminal-size   >=0.3.2.1  && <0.4+    , text            >=1.2.3.1  && <1.3+    , time            >=1.8.0.2  && <1.12+    , transformers    >=0.5.6.2  && <0.6+    , which           >=0.2      && <0.3++source-repository head+  type:     git+  location: https://github.com/obsidiansystems/cli-extras
src/Cli/Extras.hs view
@@ -1,8 +1,6 @@--- | Package for writing great CLI apps.------ See Demo.hs for an example------ This package should eventually be made its own library.+{-|+Description: Convenience functions for writing CLI applications+|-} module Cli.Extras   (   -- .Types
src/Cli/Extras/Logging.hs view
@@ -71,9 +71,7 @@ mkDefaultCliConfig cliArgs = do   let logLevel = if any (`elem` ["-v", "--verbose"]) cliArgs then Debug else Notice   notInteractive <- not <$> isInteractiveTerm-  cliConf <- newCliConfig logLevel notInteractive notInteractive--  return cliConf+  newCliConfig logLevel notInteractive notInteractive   where     isInteractiveTerm = do       isTerm <- hIsTerminalDevice stdout@@ -92,7 +90,7 @@   :: Severity   -> Bool   -> Bool-  -> IO (CliConfig)+  -> IO CliConfig newCliConfig sev noColor noSpinner = do   level <- newIORef sev   lock <- newMVar False
src/Cli/Extras/Spinner.hs view
@@ -76,7 +76,7 @@       logMessage Output_ClearLine       cliConf <- getCliConfig       let theme = _cliConfig_theme cliConf-      logsM <- modifyStack $ (popSpinner theme) $ case resultM of+      logsM <- modifyStack $ popSpinner theme $ case resultM of         Nothing ->           ( TerminalString_Colorized Red $ _cliTheme_failed $ _cliConfig_theme cliConf           , Just msg  -- Always display final message if there was an exception.@@ -116,7 +116,7 @@ renderSpinnerStack theme mark = L.intersperse space . go . L.reverse   where     go [] = []-    go (x:[]) = mark : [x]+    go [x] = mark : [x]     go (x:xs) = arrow : x : go xs     arrow = TerminalString_Colorized Blue $ _cliTheme_arrow theme     space = TerminalString_Normal " "
src/Cli/Extras/SubExcept.hs view
@@ -4,7 +4,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-}
src/Cli/Extras/Types.hs view
@@ -1,11 +1,8 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE FunctionalDependencies #-}-{-# LANGUAGE LambdaCase #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE UndecidableInstances #-} module Cli.Extras.Types where@@ -39,8 +36,6 @@ type CliLog m = MonadLog Output m  type CliThrow e m = MonadError e m--deriving instance MonadFail m => MonadFail (LoggingT Output m)  --------------------------------------------------------------------------------