From b8193e40719a2a72d9b25e8ea3070c0e84beb48e Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 15 Jun 2017 15:22:06 +0200 Subject: command: add all options to property->option bridge Before this, options with co->data==NULL (i.e. no storage) were not added to the bridge (except alias options). There are a few options which might make sense to allow via the bridge ("profile" and "include"). So allow them. In command_init(), we merely remove the co->data check, the rest of the diff is due to switching the if/else branches for convenience. We also must explicitly error on M_PROPERTY_GET if co->data==NULL. All other cases check it in some way. Explicitly exclude options from the property bridge, which would be added due this, and the result would be pointless. --- options/options.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'options/options.c') diff --git a/options/options.c b/options/options.c index 1bcdc720f2..90cbe61d6f 100644 --- a/options/options.c +++ b/options/options.c @@ -254,21 +254,25 @@ const struct m_sub_options dvd_conf = { const m_option_t mp_opts[] = { // handled in command line pre-parser (parse_commandline.c) - {"v", CONF_TYPE_STORE, M_OPT_FIXED | CONF_NOCFG, .offset = -1}, + {"v", CONF_TYPE_STORE, M_OPT_FIXED | CONF_NOCFG | M_OPT_NOPROP, .offset = -1}, {"playlist", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_MIN | M_OPT_FIXED | M_OPT_FILE, .min = 1, .offset = -1}, - {"{", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED, .offset = -1}, - {"}", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED, .offset = -1}, + {"{", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP, .offset = -1}, + {"}", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP, .offset = -1}, // handled in m_config.c { "include", CONF_TYPE_STRING, M_OPT_FILE, .offset = -1}, { "profile", CONF_TYPE_STRING_LIST, 0, .offset = -1}, - { "show-profile", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED, .offset = -1}, - { "list-options", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED, .offset = -1}, + { "show-profile", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP, + .offset = -1}, + { "list-options", CONF_TYPE_STORE, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP, + .offset = -1}, OPT_FLAG("list-properties", property_print_help, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP), - { "help", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED, .offset = -1}, - { "h", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED, .offset = -1}, + { "help", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP, + .offset = -1}, + { "h", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_FIXED | M_OPT_NOPROP, + .offset = -1}, OPT_PRINT("list-protocols", stream_print_proto_list), OPT_PRINT("version", print_version), -- cgit v1.2.3