Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.
/ git-config Public archive
forked from dogonthehorizon/git-config

A simple parser for Git configuration files.

License

Notifications You must be signed in to change notification settings

fossas/git-config

 
 

Repository files navigation

Build Status

git-config

A simple parser for Git configuration files.

Getting Started

This project is built using Stack, make sure you have it installed before proceeding.

You can fire up an interactive session like so:

stack ghci

The library can be built or tested like so:

# Building
stack build
# Running tests
stack test

Usage

A Git configuration is a colletion of sections that contain mappings of keys to values.

For the sake of simplicity this is represented as [Section] where a Section is a collection of section names and a mapping of keys to values.

We can use the parser like so:

import qualified Data.Text.IO as TIO
import Text.GitConfig.Parser (parseConfig)

main :: IO ()
main = do
  file <- TIO.readFile ".git/config"
  case parseConfig file of
    Right conf ->
      print conf
    Left error ->
      print error

If you'd like to do your own parsing you can import the individual combinators from the Text.GitConfig.Parser module.

About

A simple parser for Git configuration files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Haskell 90.2%
  • Makefile 7.2%
  • Shell 2.6%