package scfg

  1. Overview
  2. Docs
OCaml library and executable to work with the scfg configuration file format

Install

Dune Dependency

Authors

Maintainers

Sources

0.3.tar.gz
sha256=42149d1b908de191e1d96dcce3289ba15337ac912af4db9dbf70625ac60da9cd
sha512=8592f6c53bded156573f4d30381792d99b5ad2f570124fd60e477f8f9e11a4556fe877181bc5d9e86896aea415576678399091d15719491f573fa055ca5f1b68

Description

scfg is an OCaml library and executable to work with the scfg configuration file format. It provides a parser, a pretty printer and a module to perform queries.

README

scfg

scfg is an OCaml executable and library to work with the scfg configuration file format.

Installation

scfg can be installed with opam:

opam install scfg

If you don't have opam, you can install it following the how to install opam guide.

If you can't or don't want to use opam, consult the opam file for build instructions.

Quickstart

Using the library to parse a scfg file and reprint nicely:

open Scfg

let config =
  match Parse.from_file "config.scfg" with
  | Ok config -> config
  | Error e -> begin
    Format.eprintf "error: %s@." e;
    exit 1
  end

let () =
  Format.printf "%a@." Pp.config config

The provided binary does exactly this. If you have the following config.scfg file:

   name "a"        "b b b" 'c' {


       child1       ""    "I'm léo"

                child2 'nono'
     }

Running the binary on it will reprint it trying to make the output pretty:

$ scfg config.scfg
name a "b b b" c {
  child1 "" "I'm léo"
  child2 nono
}

For more, have a look at the example folder, at the documentation or at the test suite.

About

Dependencies (4)

  1. sedlex
  2. menhir >= "20211230"
  3. ocaml >= "4.13"
  4. dune >= "2.8"

Dev Dependencies (1)

  1. odoc with-doc

Conflicts

None

OCaml

Innovation. Community. Security.