Skip to content

Instantly share code, notes, and snippets.

@jreidinger jreidinger/hana.aug
Created Sep 29, 2016

Embed
What would you like to do?
(* 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
You can’t perform that action at this time.