mpv-player / mpv-player/mpv

Is --msg-level a candiate for list option syntax?

Open
#11,760 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

meta:feature-request
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Currently, --msg-level can only be set like this:

msg-level=all=warn,autoload=warn,cat_ntap=trace

IMO, it would be more ergonomic to set it using the list option syntax, like this:

msg-level=all=warn
msg-levels-append=autoload=warn
msg-levels-append=cat_ntap=trace

It might add confusion, however, the ordering of module/level pairs in --msg-level already matters (e.g. in msg-level=cat_watch_history=trace,all=fatal, cat_watch_history=trace is overridden by all=fatal) and this is already stated in the manual:

Key/value list options
A key/value list is a list of key/value string pairs. In programming languages, this type of data structure is often called a map or a dictionary. The order normally does not matter, although in some cases the order might matter.

Is there a reason why --msg-level doesn't support this syntax? Has it simply never been added? If this is the only barrier, I don't mind submitting a pull request with this functionality.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the manual entries for --msg-level and list options, then trace the existing --msg-level option parsing in the mpv source. Confirm whether repeated list-style assignments can be supported without changing the documented ordering behavior; done means the proposed syntax works and its precedence is clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.