Adding --help option to flterm.
authorTim 'mithro' Ansell <mithro@mithis.com>
Sun, 20 Sep 2015 13:09:16 +0000 (23:09 +1000)
committerSebastien Bourdeauducq <sb@m-labs.hk>
Mon, 21 Sep 2015 03:02:36 +0000 (11:02 +0800)
tools/flterm.c

index 2a1c71077aeaf99a2d4e0bed1fd776817e73062e..17d28a2e1fc39a6e13d851d4b6b8956feff216fc 100644 (file)
@@ -579,7 +579,8 @@ enum {
        OPTION_CMDLINEADR,
        OPTION_INITRD,
        OPTION_INITRDADR,
-       OPTION_LOG
+       OPTION_LOG,
+       OPTION_HELP,
 };
 
 static const struct option options[] = {
@@ -638,6 +639,11 @@ static const struct option options[] = {
                .has_arg = 1,
                .val = OPTION_LOG
        },
+       {
+               .name = "help",
+               .has_arg = 0,
+               .val = OPTION_HELP
+       },
        {
                .name = NULL
        }
@@ -753,6 +759,9 @@ int main(int argc, char *argv[])
                                free(log_path);
                                log_path = strdup(optarg);
                                break;
+                       case OPTION_HELP:
+                               print_usage();
+                               return 0;
                }
        }