An open API service indexing awesome lists of open source software.

https://github.com/costava/alignchar


https://github.com/costava/alignchar

c c99

Last synced: 9 months ago
JSON representation

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`.