mirror of
https://github.com/mpv-player/mpv
synced 2025-04-17 04:40:09 +00:00
options: change --h=... behavior
Does not match a shell pattern anymore. Instead, a simple sub-string search is done.
This commit is contained in:
parent
a8347eb9ba
commit
aab98776f6
@ -350,9 +350,10 @@ Program Behavior
|
||||
``--help``, ``--h``
|
||||
Show short summary of options.
|
||||
|
||||
You can also pass a shell pattern to this option, which will list all
|
||||
matching top-level options, e.g. ``--h=*scale*`` for all options that
|
||||
contain the word "scale".
|
||||
You can also pass a string to this option, which will list all top-level
|
||||
options which contain the string in the name, e.g. ``--h=scale`` for all
|
||||
options that contain the word ``scale``. The special string ``*`` lists
|
||||
all top-level options.
|
||||
|
||||
``-v``
|
||||
Increment verbosity level, one level for each ``-v`` found on the command
|
||||
|
@ -29,10 +29,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#if HAVE_FNMATCH
|
||||
#include <fnmatch.h>
|
||||
#endif
|
||||
|
||||
#include "libmpv/client.h"
|
||||
|
||||
#include "mpv_talloc.h"
|
||||
@ -956,10 +952,8 @@ void m_config_print_option_list(const struct m_config *config, const char *name)
|
||||
const struct m_option *opt = co->opt;
|
||||
if (co->is_hidden)
|
||||
continue;
|
||||
#if HAVE_FNMATCH
|
||||
if (fnmatch(name, co->name, 0))
|
||||
if (strcmp(name, "*") != 0 && !strstr(co->name, name))
|
||||
continue;
|
||||
#endif
|
||||
MP_INFO(config, " %s%-30s", prefix, co->name);
|
||||
if (opt->type == &m_option_type_choice) {
|
||||
MP_INFO(config, " Choices:");
|
||||
|
@ -96,7 +96,7 @@ const char mp_help_text[] =
|
||||
" --playlist=<file> specify playlist file\n"
|
||||
"\n"
|
||||
" --list-options list all mpv options\n"
|
||||
" --h=<pat> print options which match the given shell pattern\n"
|
||||
" --h=<string> print options which contain the given string in their name\n"
|
||||
"\n";
|
||||
|
||||
static pthread_mutex_t terminal_owner_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
4
wscript
4
wscript
@ -127,10 +127,6 @@ main_dependencies = [
|
||||
# This should be good enough.
|
||||
'func': check_statement(['poll.h', 'unistd.h', 'sys/mman.h'],
|
||||
'struct pollfd pfd; poll(&pfd, 1, 0); fork(); int f[2]; pipe(f); munmap(f,0)'),
|
||||
}, {
|
||||
'name': 'fnmatch',
|
||||
'desc': 'fnmatch()',
|
||||
'func': check_statement('fnmatch.h', 'fnmatch("", "", 0)')
|
||||
}, {
|
||||
'name': 'posix-or-mingw',
|
||||
'desc': 'development environment',
|
||||
|
Loading…
Reference in New Issue
Block a user