zapashcanon ecc8140d24
Some checks failed
build / build (push) Failing after 2m34s
add lower bound on cmdliner
2025-02-04 15:50:16 +01:00
2025-01-20 03:29:59 +01:00
2022-01-23 21:17:58 +01:00
0.5
2025-02-04 09:18:23 +01:00
0.5
2025-02-04 09:18:23 +01:00
2022-01-23 19:46:42 +01:00
2025-02-04 15:50:16 +01:00
2025-02-04 15:50:16 +01:00
2022-01-23 21:31:47 +01:00
2022-01-30 00:50:45 +01:00
2025-02-04 15:50:16 +01:00

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

Description
No description provided
Readme
Languages
OCaml 86.5%
Perl 8.2%
Dune 5.3%