options: add --script-opt alias for --script-opts-append

This commit is contained in:
Kacper Michajłow 2024-10-21 21:32:08 +02:00
parent 4045fac980
commit 153d4927ab
4 changed files with 10 additions and 5 deletions

View File

@ -0,0 +1 @@
add `--script-opt` alias for `--script-opts-append`

View File

@ -828,12 +828,15 @@ Program Behavior
``--scripts`` is a path list option. See `List Options`_ for details.
``--script-opts=key1=value1,key2=value2,...``
``--script-opt=<key=value>``, ``--script-opts=key1=value1,key2=value2,...``
Set options for scripts. A script can query an option by key. If an
option is used and what semantics the option value has depends entirely on
the loaded scripts. Values not claimed by any scripts are ignored.
This is a key/value list option. See `List Options`_ for details.
Each use of the ``--script-opt`` option will add another option to the
internal list, while ``--script-opts`` takes a list of options at once,
and overwrites the internal list with it. The latter is a key/value list
option. See `List Options`_ for details.
``--merge-files``
Pretend that all files passed to mpv are concatenated into a single, big

View File

@ -251,11 +251,11 @@ The keys are grouped automatically using a simple analysis of the command
string, and one should not expect documentation-level grouping accuracy,
however, it should still be reasonably useful.
Using ``--idle --script-opts-append=stats-bindlist=yes`` will print the list to
Using ``--idle --script-opt=stats-bindlist=yes`` will print the list to
the terminal and quit immediately. Long lines are clipped to the terminal width
unless this is disabled with ``--script-opts-append=stats-term_clip=no``. Escape
unless this is disabled with ``--script-opt=stats-term_clip=no``. Escape
sequences can be disabled by adding ``-`` before ``yes``, i.e.
``--script-opts-append=stats-bindlist=-yes``.
``--script-opt=stats-bindlist=-yes``.
Like with ``--input-test``, the list includes bindings from ``input.conf`` and
from user scripts. Use ``--no-config`` to list only built-in bindings.

View File

@ -557,6 +557,7 @@ static const m_option_t mp_opts[] = {
{"scripts", OPT_PATHLIST(script_files), .flags = M_OPT_FILE},
{"script", OPT_CLI_ALIAS("scripts-append")},
{"script-opts", OPT_KEYVALUELIST(script_opts)},
{"script-opt", OPT_CLI_ALIAS("script-opts-append")},
{"load-scripts", OPT_BOOL(auto_load_scripts)},
#endif
#if HAVE_JAVASCRIPT