Permalink
Browse files

Added set_colon_field, same as set_user_field but with a generic name.

  • Loading branch information...
1 parent 056704b commit 0e61ac219125b220481bca6f1a59a82d70cdef6e @zzamboni zzamboni committed Mar 12, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 cfengine_stdlib.cf
View
@@ -422,6 +422,22 @@ insert_lines:
##
+bundle edit_line set_colon_field(key,field,val)
+
+ # Set the value of field number "field" of the
+ # line whose first field is "key", in a colon-separated file.
+
+{
+field_edits:
+
+ "$(key):.*"
+
+ comment => "Edit a colon-separated file, using the first field as a key",
+ edit_field => col(":","$(field)","$(val)","set");
+}
+
+##
+
bundle edit_line set_user_field(user,field,val)
# Set the value of field number "field" in

0 comments on commit 0e61ac2

Please sign in to comment.