GitHunt
AL

alexykn/trailfix

trim trailing whitespace and ensure single newline at EOF

trailfix

Trim trailing whitespace and ensure single newline at EOF.

Usage

# 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.txt

Installation

From crates.io

cargo install trailfix

From source

cargo install --path .

Building

cargo build --release

Contributors

MIT License
Created September 30, 2025
Updated December 1, 2025
alexykn/trailfix | GitHunt