Seems to have been omitted by mistake and nobody ever noticed.
Unified · Split
| @@ -1,2 +1,3 @@ | ||
| 1 | 1 | undeprecate list option suffixes that work with multiple items |
| 2 | 2 | add `-del` to string list and keyvalue list options |
| 3 | +add `-clr` to keyvalue list options | |
| @@ -676,6 +676,7 @@ Suffix Meaning · 675 unmodified lines | ||
| 676 | 676 | -set Set a list of items (using ``,`` as separator) |
| 677 | 677 | -append Append a single item (escapes for the key, no escapes for the value) |
| 678 | 678 | -add Append 1 or more items (same syntax as -set) |
| 679 | +-clr Clear the option (remove all items) | |
| 679 | 680 | -del Delete 1 or more keys if present (same syntax as -set) |
| 680 | 681 | -remove Delete item by key if present (does not interpret escapes) |
| 681 | 682 | ============= =============================================== |
| @@ -1718,6 +1718,10 @@ static int parse_keyvalue_list(struct mp_log *log, const m_option_t *opt, · 1717 unmodified lines | ||
| 1718 | 1718 | append = true; |
| 1719 | 1719 | } else if (bstr_endswith0(name, "-append")) { |
| 1720 | 1720 | append = full_value = true; |
| 1721 | + } else if (bstr_endswith0(name, "-clr")) { | |
| 1722 | + if (dst) | |
| 1723 | + free_str_list(dst); | |
| 1724 | + return 0; | |
| 1721 | 1725 | } else if (op == OP_DEL || op == OP_REMOVE) { |
| 1722 | 1726 | int n = 0; |
| 1723 | 1727 | char **res = separate_input_param(opt, param, &n, op); |
| @@ -1861,6 +1865,7 @@ const m_option_type_t m_option_type_keyvalue_list = { · 137 unmodified lines | ||
| 1861 | 1865 | .actions = (const struct m_option_action[]){ |
| 1862 | 1866 | {"add"}, |
| 1863 | 1867 | {"append"}, |
| 1868 | + {"clr", M_OPT_TYPE_OPTIONAL_PARAM}, | |
| 1864 | 1869 | {"del"}, |
| 1865 | 1870 | {"set"}, |
| 1866 | 1871 | {"remove"}, |