diff options
Diffstat (limited to '')
-rw-r--r-- | ReadMe.c | 11 | ||||
-rw-r--r-- | mdadm.c | 15 | ||||
-rw-r--r-- | mdadm.h | 2 |
3 files changed, 17 insertions, 11 deletions
@@ -600,3 +600,14 @@ char Help_config[] = "\n" ; +char *mode_help[mode_count] = { + [0] = Help, + [ASSEMBLE] = Help_assemble, + [BUILD] = Help_build, + [CREATE] = Help_create, + [MANAGE] = Help_manage, + [MISC] = Help_misc, + [MONITOR] = Help_monitor, + [GROW] = Help_grow, + [INCREMENTAL] = Help_incr, +}; @@ -1136,20 +1136,13 @@ int main(int argc, char *argv[]) } if (print_help) { - char *help_text = Help; + char *help_text; if (print_help == 2) help_text = OptionHelp; else - switch (mode) { - case ASSEMBLE : help_text = Help_assemble; break; - case BUILD : help_text = Help_build; break; - case CREATE : help_text = Help_create; break; - case MANAGE : help_text = Help_manage; break; - case MISC : help_text = Help_misc; break; - case MONITOR : help_text = Help_monitor; break; - case GROW : help_text = Help_grow; break; - case INCREMENTAL:help_text= Help_incr; break; - } + help_text = mode_help[mode]; + if (help_text == NULL) + help_text = Help; fputs(help_text,stdout); exit(0); } @@ -264,6 +264,7 @@ enum mode { GROW, INCREMENTAL, AUTODETECT, + mode_count }; extern char short_options[]; @@ -271,6 +272,7 @@ extern char short_bitmap_options[]; extern char short_bitmap_auto_options[]; extern struct option long_options[]; extern char Version[], Usage[], Help[], OptionHelp[], + *mode_help[], Help_create[], Help_build[], Help_assemble[], Help_grow[], Help_incr[], Help_manage[], Help_misc[], Help_monitor[], Help_config[]; |