diff options
author | Amit Kucheria <amit.kucheria@linaro.org> | 2014-05-29 01:00:07 +0530 |
---|---|---|
committer | Amit Kucheria <amit.kucheria@linaro.org> | 2014-06-01 15:44:23 +0530 |
commit | f5622f66caba548cc7a3402b19187ee5064016cc (patch) | |
tree | 6cfa2ee82cccb22891f8b060b13688a66a5e0f40 | |
parent | 967a8a75a7e6637afc4a71f0e90c1256c7b7b95a (diff) |
struct option long_options doesn't need to be global
Change the flag field to NULL while we're at it
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
-rw-r--r-- | idlestat.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -955,17 +955,6 @@ static void version(const char *cmd) printf("%s version %s\n", basename(cmd), IDLESTAT_VERSION); } -static struct option long_options[] = { - { "debug", no_argument, 0, 'd' }, - { "help", no_argument, 0, 'h' }, - { "iterations", required_argument, 0, 'i' }, - { "dump", no_argument, 0, 'm' }, - { "output-file", required_argument, 0, 'o' }, - { "duration", required_argument, 0, 't' }, - { "version", no_argument, 0, 'V' }, - { 0, 0, 0, 0 } -}; - struct idledebug_options { bool debug; bool dump; @@ -976,6 +965,16 @@ struct idledebug_options { int getoptions(int argc, char *argv[], struct idledebug_options *options) { + struct option long_options[] = { + { "debug", no_argument, NULL, 'd' }, + { "help", no_argument, NULL, 'h' }, + { "iterations", required_argument, NULL, 'i' }, + { "dump", no_argument, NULL, 'm' }, + { "output-file", required_argument, NULL, 'o' }, + { "duration", required_argument, NULL, 't' }, + { "version", no_argument, NULL, 'V' }, + { 0, 0, 0, 0 } + }; int c; memset(options, 0, sizeof(*options)); |