2 files changed, 6 insertions(+), 1 deletion(-)
lenses/hosts.aug | 2 +-
lenses/tests/test_hosts.aug | 5 +++++
# HG changeset patch
# User David Lutterkort <[EMAIL PROTECTED]>
# Date 1218589084 25200
# Node ID 311a5cee52239fc27a496e8e42f761b8c1741d87
# Parent b76874a306e98a939258133b865f75df39845678
Hosts: handle comments at the end of a host entry
Comments are put into the tree as part of that host node, i.e. will live as
long as the host entry.
Based on an initial patch by Kjetil Torgrim Homme <[EMAIL PROTECTED]>
diff -r b76874a306e9 -r 311a5cee5223 lenses/hosts.aug
--- a/lenses/hosts.aug Tue Aug 12 18:41:18 2008 +0200
+++ b/lenses/hosts.aug Tue Aug 12 17:58:04 2008 -0700
@@ -17,7 +17,7 @@
[ label "ipaddr" . store word ] . sep_tab .
[ label "canonical" . store word ] .
[ label "alias" . sep_spc . store word ]*
- . eol ]
+ . (comment|eol) ]
let lns = ( empty | comment | record ) *
diff -r b76874a306e9 -r 311a5cee5223 lenses/tests/test_hosts.aug
--- a/lenses/tests/test_hosts.aug Tue Aug 12 18:41:18 2008 +0200
+++ b/lenses/tests/test_hosts.aug Tue Aug 12 17:58:04 2008 -0700
@@ -51,6 +51,11 @@
{ "canonical" = "etch.example.com" }
{ "alias" = "etch" } }
+ (* Comment at the end of a line *)
+ test Hosts.lns get "127.0.0.1 localhost # must always be there \n" =
+ { "1" { "ipaddr" = "127.0.0.1" }
+ { "canonical" = "localhost" }
+ { "comment" = "must always be there" } }
(* Local Variables: *)
(* mode: caml *)
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel