Show alias in command help
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 5c5d2ad989fc23e627cc17a46ea1e7af70d9f848..f503916de528852135936fb2435543468ed5b256 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -379,6 +379,8 @@ static int handle_option(struct fio_option *o, const char *ptr, void *data)
                ptr2 = strchr(ptr, ',');
                if (!ptr2)
                        ptr2 = strchr(ptr, ':');
+               if (!ptr2)
+                       ptr2 = strchr(ptr, '-');
        }
 
        /*
@@ -500,6 +502,9 @@ static void show_option_help(struct fio_option *o)
                "no argument (opt)",
        };
 
+       if (o->alias)
+               printf("%20s: %s\n", "alias", o->alias);
+
        printf("%20s: %s\n", "type", typehelp[o->type]);
        printf("%20s: %s\n", "default", o->def ? o->def : "no default");
        show_option_range(o);
@@ -522,7 +527,8 @@ int show_cmd_help(struct fio_option *options, const char *name)
                int match = 0;
 
                if (name) {
-                       if (!strcmp(name, o->name))
+                       if (!strcmp(name, o->name) ||
+                           (o->alias && !strcmp(name, o->alias)))
                                match = 1;
                        else {
                                unsigned int dist;