Skip to content

Commit 8aa7853

Browse files
committed
[README.md] add head and tail documentation
1 parent 42cb4a8 commit 8aa7853

File tree

1 file changed

+25
-4
lines changed

1 file changed

+25
-4
lines changed

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@
1919

2020
- Takes two font file path arguments for comparison
2121
- Dumps OpenType table data in the fontTools library TTX format (XML)
22-
- Compares the OpenType table data across the two files using the unified diff format with 3 lines of context by default
22+
- Compares the OpenType table data across the two files using the unified diff format with 3 lines of surrounding context
2323

2424
## Optional Features
2525

26+
- View colored diffs in the terminal with the `-c` or `--color` flag
2627
- Filter OpenType tables with the `--include` or `--exclude` options
2728
- Modify the number of context lines displayed in the diff with the `-l` or `--lines` option
28-
- View colored diffs in the terminal with the `-c` or `--color` flag
29+
- Display the first n lines of the diff output with the `--head` option
30+
- Display the last n lines of the diff output with the `--tail` option
31+
2932

3033
Run `fdiff --help` to view all available options.
3134

@@ -67,7 +70,9 @@ $ pip3 install --ignore-installed -r requirements.txt -e ".[dev]"
6770
$ fdiff [OPTIONS] [PRE-FONT FILE PATH] [POST-FONT FILE PATH]
6871
```
6972

70-
By default, an uncolored unified diff is performed on the two files defined with the local file paths in the above command.
73+
By default, an uncolored unified diff is performed on the two files defined with the local file paths in the above command.
74+
75+
### Options
7176

7277
#### Color diffs
7378

@@ -93,14 +98,30 @@ $ fdiff --exclude glyf,OS/2 [PRE-FONT FILE PATH] [POST-FONT FILE PATH]
9398

9499
**Do not include spaces** between the comma separated table name values!
95100

96-
#### Change Number of Context Lines
101+
#### Change number of context lines
97102

98103
To change the number of lines of context above/below lines that have differences, use the `-l` or `--lines` option with an integer value for the desired number of lines. The following command reduces the contextual information to a single line above and below lines with differences:
99104

100105
```
101106
$ fdiff -l 1 [PRE-FONT FILE PATH] [POST-FONT FILE PATH]
102107
```
103108

109+
#### Display first n lines of output
110+
111+
Use the `--head` option followed by an integer for the number of lines at the beginning of the output. For example, the following command displays the first 20 lines of the diff:
112+
113+
```
114+
$ fdiff --head 20 [PRE-FONT FILE PATH] [POST-FONT FILE PATH]
115+
```
116+
117+
#### Display the last n lines of output
118+
119+
Use the `--tail` option followed by an integer for the number of lines at the end of the output. For example, the following command displays the last 20 lines of the diff:
120+
121+
```
122+
$ fdiff --tail 20 [PRE-FONT FILE PATH] [POST-FONT FILE PATH]
123+
```
124+
104125
### Other Options
105126

106127
Use `fdiff -h` to view all available options.

0 commit comments

Comments
 (0)