docs: tighten example and merge input-handling decisions

Drop the verbatim config.txt and input.txt listings from the example;
both files are in the repository root. Merge the whitespace and line
terminator notes into a single input-handling decision.
This commit is contained in:
2026-08-25 21:23:49 +02:00
parent 40ea68be11
commit 03bec6404f

View File

@@ -17,24 +17,7 @@ python main.py <config_file> <text_file>
### Example
With the provided `config.txt`:
```
a=z
bb=y
c=x
```
and `input.txt`:
```
jgrebbk6hnae
cnhjrfyjvth3nxr
b#sjcf_ansbbbbbvo!
dajf#aemfaocfna%
```
running:
With the provided `config.txt` and `input.txt`, running:
```bash
python main.py config.txt input.txt
@@ -77,12 +60,10 @@ lines but also to output the resulting text. Dropping lines that happened to
match nothing would silently lose content, so every line is printed and lines
with zero replacements simply sort last.
**Whitespace inside configuration values is significant.** The format has no
quoting or escaping, so a trailing space in `a=z ` is kept as part of the
replacement value; stripping it would make such a value impossible to express.
**Only the line terminator is stripped.** Both `\n` and `\r\n` are handled, and
every other character of the line is preserved and eligible for replacement.
**Input is preserved apart from the line terminator.** Both `\n` and `\r\n` are
stripped; every other character is kept and eligible for replacement. The
configuration format has no quoting either, so whitespace inside a value is
significant — the trailing space in `a=z ` is part of the replacement value.
## Error handling