diff options
author | wm4 <wm4@nowhere> | 2016-12-16 16:09:10 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-12-16 16:09:10 +0100 |
commit | aab98776f602a4bec1a74ee87eb829aadf6437ea (patch) | |
tree | 546340338050917156d3335ff43c52007f18e21c | |
parent | a8347eb9ba9e09177da50592fde7f3ae7261ce59 (diff) |
options: change --h=... behavior
Does not match a shell pattern anymore. Instead, a simple sub-string
search is done.
-rw-r--r-- | DOCS/man/options.rst | 7 | ||||
-rw-r--r-- | options/m_config.c | 8 | ||||
-rw-r--r-- | player/main.c | 2 | ||||
-rw-r--r-- | wscript | 4 |
4 files changed, 6 insertions, 15 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index e355d933d9..0dd3aad59b 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -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 diff --git a/options/m_config.c b/options/m_config.c index 2dc3eb569d..14aa56da51 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -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:"); diff --git a/player/main.c b/player/main.c index 1f32d375bd..8ebfc357a2 100644 --- a/player/main.c +++ b/player/main.c @@ -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; @@ -128,10 +128,6 @@ main_dependencies = [ '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', 'deps_any': [ 'posix', 'mingw' ], |