https://github.com/costava/alignchar
https://github.com/costava/alignchar
c c99
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/costava/alignchar
- Owner: Costava
- License: bsd-2-clause
- Created: 2021-04-01T03:10:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-06T00:00:48.000Z (about 5 years ago)
- Last Synced: 2025-02-02T02:13:40.871Z (over 1 year ago)
- Topics: c, c99
- Language: C
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# alignchar
```
$ ./alignchar --help
alignchar: For the given input file, for each line that ends in the target
character (Default: '\'), align the target character to the
target column position (Default: 80. First column is 1) using the
fill character (Default: ' '). Non-matching lines, lines of
length 2048 and greater, and lines where the target character
falls on or after the target column position are unchanged.
Usage examples:
alignchar [options] -i -o
alignchar [options] -i --in-place
An input file must be specified (-i or --input).
Either an output file must be specified (-o or --output)
or --in-place must be specified meaning modify the input file.
Options may be given in any order.
Options:
--help Stop parsing options, print help, exit(0)
--version Stop parsing options, print version, exit(0)
-i, --input Specify input file (required)
-o, --output Specify output file
(mutually exclusive with --in-place)
Do NOT specify the same path as for input
(use --in-place instead)
--in-place Modify input file
(mutually exclusive with -o, --output)
-c, --char Specify the character to be aligned (Default: '\')
-p, --position Specify the column to align the character to
(Default: 80)
-f, --fill Specify the fill character (Default: ' ')
-t, --tab-width Specify tab width (Default: 4)
```
Only depends on the C99 standard library.
Never dynamically allocates memory.
May produce unexpected results:
- On non-ASCII files
- On files with CRLF line endings
## Build
Build with `make` or any C99 compiler
Run the tests with `make test`
## License
BSD 2-Clause License. See file `LICENSE.txt`.