Trim trailing whitespace and ensure single newline at EOF.
# Print fixed content to stdout
tf file.txt
# Multiple files
tf file1.txt file2.txt file3.txt
# Directory (non-recursive)
tf dir/
# Directory (recursive)
tf -r dir/
# Overwrite files in place
tf -o file.txt
tf --overwrite file.txt
# Redirect output to new file
tf file.txt > fixed.txt
# Pipe from stdin
curl https://example.com/file.txt | tf > fixed.txtcargo install trailfixcargo install --path .cargo build --release