diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-07-16 12:06:20 +0300 |
---|---|---|
committer | avih <avih@users.noreply.github.com> | 2021-07-19 22:06:50 +0300 |
commit | 2335ee55146caebd40698596484befa867470188 (patch) | |
tree | e9b1a2faf23694b15d59fce5070c7f2e112b0ca4 /waftools | |
parent | 9fb200b6419c2707a5ec8d0786ae24ed02194297 (diff) | |
download | mpv-2335ee55146caebd40698596484befa867470188.tar.bz2 mpv-2335ee55146caebd40698596484befa867470188.tar.xz |
stats.lua: page 4 (keys): support help-like terminal printout
While --input-test is useful, and so is page 4 of stats, until now
there was no way to simply print the list in a help-like fashion.
This commit adds such printout, invoked by the script opt
stats-bindlist=yes, which uses the existing page 4 code. This prints
the list on startup and quits immediately - like any help page.
It's awkward to invoke compared to other help pages, and it does
require the stats page to be enabled (it is by default), however
it is a script-generated output, and currently there's no other
method to print a help page generated by a script.
The printout itself is performed using lua's io.write. While reliable,
it's not the standard way for mpv to print to the terminal.
Other possible printout methods are mp.msg.info - which also prints
"[stats]" prefix on each line (ugly), or forcing term-osd and setting
an osd-message which mpv will then print at the terminal - however
that's printed to stderr, and could also be subject to timing concerns
since we quit right afterwards.
In the future we can consider changing/integrating the invocation so
that mpv itself could print a help page generated by a script, thus
solving both the awkward invocation and printout-method issues.
Diffstat (limited to 'waftools')
0 files changed, 0 insertions, 0 deletions