resolved #444 add messaging to __line-type (#580)

#444 Add messaging to __line-type
This commit is contained in:
tom 2017-09-27 12:19:07 +02:00 committed by Darko Poljak
parent e5881301ad
commit 7ee56d099f
2 changed files with 11 additions and 2 deletions

View file

@ -60,6 +60,7 @@ case "$state_should" in
# Only replace ' with '"'"' and keep \ as they are # Only replace ' with '"'"' and keep \ as they are
line_sanitised=$(cat "$__object/parameter/line" | sed -e "s/'/'\"'\"'/g") line_sanitised=$(cat "$__object/parameter/line" | sed -e "s/'/'\"'\"'/g")
printf '%s' "printf '%s\n' '$line_sanitised' >> $file" printf '%s' "printf '%s\n' '$line_sanitised' >> $file"
echo "added" >> "$__messages_out"
;; ;;
absent) absent)
@ -83,9 +84,10 @@ fi
grep -v $greparg '$regex' '$file' > \$tmpfile || true grep -v $greparg '$regex' '$file' > \$tmpfile || true
mv -f "\$tmpfile" "$file" mv -f "\$tmpfile" "$file"
eof eof
echo "removed" >> "$__messages_out"
;; ;;
*) *)
echo "Unknown state: $state_should" >&2 echo "Unknown state: $state_should" >&2
exit 1 exit 1
;; ;;
esac esac

View file

@ -40,6 +40,13 @@ file
If supplied, use this as the destination file. If supplied, use this as the destination file.
Otherwise the object_id is used. Otherwise the object_id is used.
MESSAGES
--------
added
The line was added.
removed
The line was removed.
EXAMPLES EXAMPLES
-------- --------