From 96084e9864223e41f225236a19f7b68a5a999a56 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 29 Jan 2014 11:10:39 +0100 Subject: [PATCH] Added -h command line option --- kernel/driver.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/driver.cc b/kernel/driver.cc index ce38f59e8..52f10752b 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -473,7 +473,7 @@ int main(int argc, char **argv) } int opt; - while ((opt = getopt(argc, argv, "VSm:f:b:o:p:l:qv:ts:c:")) != -1) + while ((opt = getopt(argc, argv, "VSm:f:h:b:o:p:l:qv:ts:c:")) != -1) { switch (opt) { @@ -499,6 +499,9 @@ int main(int argc, char **argv) case 'f': frontend_command = optarg; break; + case 'h': + passes_commands.push_back(stringf("help %s", optarg)); + break; case 'b': backend_command = optarg; break; @@ -536,7 +539,7 @@ int main(int argc, char **argv) break; default: fprintf(stderr, "\n"); - fprintf(stderr, "Usage: %s [-V] [-S] [-q] [-v [-t] [-l ] [-o ] [-f ]\n", argv[0]); + fprintf(stderr, "Usage: %s [-V] [-S] [-q] [-v [-t] [-l ] [-o ] [-f ] [-h cmd] \\\n", argv[0]); fprintf(stderr, " %*s[{-s|-c} ] [-p [-p ..]] [-b ] [-m ] [ [..]]\n", int(strlen(argv[0])+1), ""); fprintf(stderr, "\n"); fprintf(stderr, " -q\n"); @@ -560,6 +563,9 @@ int main(int argc, char **argv) fprintf(stderr, " -f backend\n"); fprintf(stderr, " use the specified front for the input files on the command line\n"); fprintf(stderr, "\n"); + fprintf(stderr, " -h command\n"); + fprintf(stderr, " print the help message for the specified command\n"); + fprintf(stderr, "\n"); fprintf(stderr, " -s scriptfile\n"); fprintf(stderr, " execute the commands in the script file\n"); fprintf(stderr, "\n"); -- 2.30.2