eal: add help option
[dpdk.git] / lib / librte_eal / bsdapp / eal / eal.c
index 69f3c03..ca2f445 100644 (file)
@@ -326,8 +326,10 @@ eal_parse_args(int argc, char **argv)
                int ret;
 
                /* getopt is not happy, stop right now */
-               if (opt == '?')
+               if (opt == '?') {
+                       eal_usage(prgname);
                        return -1;
+               }
 
                ret = eal_parse_common_option(opt, optarg, &internal_config);
                /* common parser is not happy */
@@ -340,6 +342,9 @@ eal_parse_args(int argc, char **argv)
                        continue;
 
                switch (opt) {
+               case 'h':
+                       eal_usage(prgname);
+                       exit(EXIT_SUCCESS);
                default:
                        if (opt < OPT_LONG_MIN_NUM && isprint(opt)) {
                                RTE_LOG(ERR, EAL, "Option %c is not supported "