Skip to content

Instantly share code, notes, and snippets.

@jreidinger
Created September 29, 2016 15:03
Show Gist options
  • Save jreidinger/4fd460f3898a988b90a6177f03dc2954 to your computer and use it in GitHub Desktop.
Save jreidinger/4fd460f3898a988b90a6177f03dc2954 to your computer and use it in GitHub Desktop.
(* Hana global.inif module for Augeas
Author: Josef Reidinger <jreidinger@suse.cz>
hana global.ini is a standard INI File, just keys can be single char or number
*)
module Hana =
autoload xfm
(************************************************************************
* INI File settings
*
* global.ini only supports "# as commentary and "=" as separator
*************************************************************************)
let comment = IniFile.comment "#" "#"
let sep = IniFile.sep "=" "="
(************************************************************************
* ENTRY
* entry use a bit modified regexp for keys
*************************************************************************)
let entry = IniFile.indented_entry /[A-Za-z0-9][A-Za-z0-9._-]*/ sep comment
(************************************************************************
* RECORD
* global.ini uses standard INI File records
*************************************************************************)
let title = IniFile.indented_title IniFile.record_re
let record = IniFile.record title entry
let lns = IniFile.lns record comment
let filter = (incl "/hana/shared/[A-Z]{3}/global/hdb/custom/config/global.ini")
let xfm = transform lns filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment