History

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

Kacper Michajłow committed 2 years ago

Commit 153d4921 parent 4045fac4 files · +10 −5Browse files

Unified · Split

4 files
  1. DOCS/interface-changes/script-opt.txt +1 −0
  2. DOCS/man/options.rst +5 −2
  3. DOCS/man/stats.rst +3 −3
  4. options/options.c +1 −0
DOCS/interface-changes/script-opt.txt+1−0
@@ -0,0 +1 @@
1+add `--script-opt` alias for `--script-opts-append`
DOCS/man/options.rst+5−2
@@ -828,12 +828,15 @@ Program Behavior · 827 unmodified lines
828828
829829 ``--scripts`` is a path list option. See `List Options`_ for details.
830830
831−``--script-opts=key1=value1,key2=value2,...``
831+``--script-opt=<key=value>``, ``--script-opts=key1=value1,key2=value2,...``
832832 Set options for scripts. A script can query an option by key. If an
833833 option is used and what semantics the option value has depends entirely on
834834 the loaded scripts. Values not claimed by any scripts are ignored.
835835
836− This is a key/value list option. See `List Options`_ for details.
836+ Each use of the ``--script-opt`` option will add another option to the
837+ internal list, while ``--script-opts`` takes a list of options at once,
838+ and overwrites the internal list with it. The latter is a key/value list
839+ option. See `List Options`_ for details.
837840
838841 ``--merge-files``
839842 Pretend that all files passed to mpv are concatenated into a single, big
DOCS/man/stats.rst+3−3
@@ -251,11 +251,11 @@ The keys are grouped automatically using a simple analysis of the command · 250 unmodified lines
251251 string, and one should not expect documentation-level grouping accuracy,
252252 however, it should still be reasonably useful.
253253
254−Using ``--idle --script-opts-append=stats-bindlist=yes`` will print the list to
254+Using ``--idle --script-opt=stats-bindlist=yes`` will print the list to
255255 the terminal and quit immediately. Long lines are clipped to the terminal width
256−unless this is disabled with ``--script-opts-append=stats-term_clip=no``. Escape
256+unless this is disabled with ``--script-opt=stats-term_clip=no``. Escape
257257 sequences can be disabled by adding ``-`` before ``yes``, i.e.
258−``--script-opts-append=stats-bindlist=-yes``.
258+``--script-opt=stats-bindlist=-yes``.
259259
260260 Like with ``--input-test``, the list includes bindings from ``input.conf`` and
261261 from user scripts. Use ``--no-config`` to list only built-in bindings.
options/options.c+1−0
@@ -557,6 +557,7 @@ static const m_option_t mp_opts[] = { · 556 unmodified lines
557557 {"scripts", OPT_PATHLIST(script_files), .flags = M_OPT_FILE},
558558 {"script", OPT_CLI_ALIAS("scripts-append")},
559559 {"script-opts", OPT_KEYVALUELIST(script_opts)},
560+ {"script-opt", OPT_CLI_ALIAS("script-opts-append")},
560561 {"load-scripts", OPT_BOOL(auto_load_scripts)},
561562 #endif
562563 #if HAVE_JAVASCRIPT

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t