Skip to content

Commit 6aba58c

Browse files
committed
Document the key bindings
Document them in the README, the man page, and the help message.
1 parent 7ef9694 commit 6aba58c

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,21 @@ ttyplot also supports *counter* style metrics, calculating *rate* by measured ti
225225
 
226226

227227

228+
## key bindings
229+
230+
231+
when reading data from a pipe, ttyplot accepts the following commands typed at the terminal:
232+
233+
```
234+
q quit
235+
r toggle rate mode
236+
```
237+
238+
these commands do not work if the standard input is a terminal: in this case quit with <kbd>Ctrl</kbd>-<kbd>C</kbd>.
239+
240+
&nbsp;
241+
&nbsp;
242+
228243

229244
## frequently questioned answers
230245

ttyplot.1

+9
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ Print the current version and exit.
8383
.It Fl h
8484
Print this help message and exit.
8585
.El
86+
.Sh KEY BINDINGS
87+
When reading data from a pipe,
88+
.Nm
89+
accepts the following commands typed at the terminal:
90+
.Bl -tag -width Ds
91+
.It Ic q
92+
Quit.
93+
.It Ic r
94+
Toggle "rate mode" on and off.
8695
.Sh EXAMPLES
8796
CPU usage from
8897
.Xr vmstat 8

ttyplot.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ static void usage(void) {
9191
" -t title of the plot\n"
9292
" -u unit displayed beside vertical bar\n"
9393
" -v print the current version and exit\n"
94-
" -h print this help message and exit\n\n");
94+
" -h print this help message and exit\n"
95+
"\n"
96+
"Hotkeys:\n"
97+
" q quit\n"
98+
" r toggle rate mode\n");
9599
}
96100

97101
static void version(void) {

0 commit comments

Comments
 (0)