Hi list, I've been playing with comments a bit. Here is the code I've been playing with. I hope it can be useful :
====================================== module CommentTest = autoload xfm let comment = [ label "commented" . del /#[ \t\n]*/ "# " ] let record = [ seq "record" . comment? . store /[^# \t\n][^#\n]*/ . Util.del_str "\n" ] let lns = record* let conf ="test #test2 " let filter = (incl "/commenttest") let xfm = transform lns filter ======================================== And then : $ cat commenttest # test this is another test line and a third # fourth line $ augtool -r . -I . augtool> print /files/commenttest/ /files/commenttest /files/commenttest/1 = "test" /files/commenttest/1/commented /files/commenttest/2 = "this is another test line" /files/commenttest/3 = "and a third" /files/commenttest/4 = "fourth line" /files/commenttest/4/commented augtool> rm /files/commenttest/4/commented rm : /files/commenttest/4/commented 1 augtool> set /files/commenttest/3/commented " " augtool> save # test this is another test line # and a third fourth line The only down side of this is that set cannot place flags, but only set values, when 'commented' could be a simple flag. Raphael
_______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
