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:
29
README.md
29
README.md
@@ -17,24 +17,7 @@ python main.py <config_file> <text_file>
|
|||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
With the provided `config.txt`:
|
With the provided `config.txt` and `input.txt`, running:
|
||||||
|
|
||||||
```
|
|
||||||
a=z
|
|
||||||
bb=y
|
|
||||||
c=x
|
|
||||||
```
|
|
||||||
|
|
||||||
and `input.txt`:
|
|
||||||
|
|
||||||
```
|
|
||||||
jgrebbk6hnae
|
|
||||||
cnhjrfyjvth3nxr
|
|
||||||
b#sjcf_ansbbbbbvo!
|
|
||||||
dajf#aemfaocfna%
|
|
||||||
```
|
|
||||||
|
|
||||||
running:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python main.py config.txt input.txt
|
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
|
match nothing would silently lose content, so every line is printed and lines
|
||||||
with zero replacements simply sort last.
|
with zero replacements simply sort last.
|
||||||
|
|
||||||
**Whitespace inside configuration values is significant.** The format has no
|
**Input is preserved apart from the line terminator.** Both `\n` and `\r\n` are
|
||||||
quoting or escaping, so a trailing space in `a=z ` is kept as part of the
|
stripped; every other character is kept and eligible for replacement. The
|
||||||
replacement value; stripping it would make such a value impossible to express.
|
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.
|
||||||
**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.
|
|
||||||
|
|
||||||
## Error handling
|
## Error handling
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user