diff --git a/CHANGELOG.md b/CHANGELOG.md index c4f7d62..9c76528 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Revision history for trivialini +## 0.1.3.0 -- 2021-03-10 + +* Add a completeConfig method for the whole data structure + ## 0.1.2.0 -- 2021-03-07 * Simplify regex matching diff --git a/src/Trivialini.hs b/src/Trivialini.hs index d920d17..adb5a45 100644 --- a/src/Trivialini.hs +++ b/src/Trivialini.hs @@ -1,5 +1,5 @@ -- | Ultra light weight ini file parser -module Trivialini (config, configFile) where +module Trivialini (Config(..), completeConfig, config, configFile) where import Data.Map (Map, keys, empty, insert, (!)) import Text.Regex.TDFA ((=~)) @@ -71,6 +71,10 @@ rc sec values (line:lines) -- Public interface -- +-- | Return the complete config data from the given filename +completeConfig :: String -> IO Config +completeConfig file = readConfig <$> readFile file + -- | Return the config value for a given section and key from the given config config :: String -> String -> String -> String config = value . readConfig diff --git a/trivialini.cabal b/trivialini.cabal index 0a7fd11..9395b8e 100644 --- a/trivialini.cabal +++ b/trivialini.cabal @@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: trivialini -version: 0.1.2.0 +version: 0.1.3.0 synopsis: Ultra light weight ini file parser -- description: homepage: https://github.com/memowe/trivialini