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