This change adds a bool flag to indicate that the lines should be trimmed prior to comparison. This is helpful for preventing duplicates if there's a leading or trailing space in either the existing file line or candidate line being passed in.
Here's an example of the usage:
echo "foo" | anew -t bar.txt
where bar.txt contains 'foo ' (with trailing whitespace). In this case, the "foo" piped to anew will not get appended to bar.txt.
This change adds a
bool
flag to indicate that the lines should be trimmed prior to comparison. This is helpful for preventing duplicates if there's a leading or trailing space in either the existing file line or candidate line being passed in.Here's an example of the usage:
where
bar.txt
contains 'foo ' (with trailing whitespace). In this case, the"foo"
piped to anew will not get appended tobar.txt
.This closes #13