Skip to content

Commit

Permalink
Deliver the whole data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
memowe committed Mar 10, 2021
1 parent ddaae3d commit 8a1887d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion src/Trivialini.hs
Original file line number Diff line number Diff line change
@@ -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 ((=~))
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion trivialini.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8a1887d

Please sign in to comment.