summaryrefslogtreecommitdiff
path: root/cmdutils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-07-29 13:47:37 +0200
committerAnton Khirnov <anton@khirnov.net>2011-08-12 13:51:30 +0200
commitd70e51225062239c250ab6bc935b9711cf97c615 (patch)
treea0ded7d61cef002df5798cb373c16c9a92d4fc7f /cmdutils.c
parente6e6060c9be60f5eb6c94556ca4c92f76cba0d1f (diff)
cmdutils: allow ':'-separated modifiers in option names.
Diffstat (limited to 'cmdutils.c')
-rw-r--r--cmdutils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmdutils.c b/cmdutils.c
index d3fdae7600..1df2556a6f 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -141,8 +141,11 @@ void show_help_options(const OptionDef *options, const char *msg, int mask, int
}
static const OptionDef* find_option(const OptionDef *po, const char *name){
+ const char *p = strchr(name, ':');
+ int len = p ? p - name : strlen(name);
+
while (po->name != NULL) {
- if (!strcmp(name, po->name))
+ if (!strncmp(name, po->name, len) && strlen(po->name) == len)
break;
po++;
}