Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xrstf/txtidy
Combines dos2unix, trims trailing spaces and ensures clean UTF-8
https://github.com/xrstf/txtidy
Last synced: about 6 hours ago
JSON representation
Combines dos2unix, trims trailing spaces and ensures clean UTF-8
- Host: GitHub
- URL: https://github.com/xrstf/txtidy
- Owner: xrstf
- License: mit
- Created: 2016-05-04T12:22:56.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-10-15T11:01:34.000Z (about 1 year ago)
- Last Synced: 2024-12-17T13:52:30.127Z (6 days ago)
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# txtidy
This is just a very, very simple helper fixes a couple of inconsistencies in all
text files within a given directory. It performs these changes:* dos2unix
* Trailing spaces at the end of lines are removed
* All files are made to end with exactly one newline character
* UTF8-BOM is removed.I'm using this whenever I get a bunch of HTML/CSS/JS files and want to commit
them to a repository. Having clean files prevent ugly diffs later on.## Installation
```bash
go install go.xrstf.de/txtidy
```## Usage
Just run the ``txtidy`` binary and give the filename patterns to match against
all files from the starting directory resursively.```
Usage of txtidy:
-a, --all run on all files, i.e. do not exclude [.git .hg .svn node_modules bower_components vendor]
-d, --dir string root directory to search files in
-v, --verbose whether or not to print all visited files
-V, --version show version info and exit immediately
```For example:
```bash
$ txtidy *.php
$ txtidy -v *.css *.less
```