I'm certainly overlooking something obvious, but.....

Here is a way slimmed down version....

Can I get a quick hand un-sticking my brain?

my config file is:

makestep 10 3


It is the only line and it may or may not be followed by a comment.

the '10' is a threshold and the '3' an upper limit

My current (edited) stab at this is mylense.aug:

module Mylense =
  autoload xfm

let val_sep = Util.del_ws_spc

let makestep = [ val_sep . key /makestep/ . val_sep .
                      [ label "threshold" . store Rx.integer ] .
                      [ label "limit" . store Rx.integer ] ] .
                      Util.comment_or_eol

let lns = ( Util.empty | Util.comment | makestep )*

let filter = (incl "/tmp/testfile")

let xfm = transform lns filter

----------------------

I'm trying to get the resulting tree to look like:
/augeas/files/tmp/testfile/makestep/threshold = 10
/augeas/files/tmp/testfile/makestep/limit = 3

--
Pat Riehecky

Scientific Linux developer
http://www.scientificlinux.org/

_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to