aboutsummaryrefslogtreecommitdiff
path: root/idlestat.c
diff options
context:
space:
mode:
authorAmit Kucheria <amit.kucheria@linaro.org>2015-01-02 13:21:03 +0530
committerTuukka Tikkanen <tuukka.tikkanen@linaro.org>2015-01-07 09:40:07 +0200
commit5129e949cbffebb9675b133bfb9f43b135210959 (patch)
treea130203a13955176a2d01eef2b710b6f897b60ab /idlestat.c
parent6c0c9f3f3188210200abea45c8bcd8cb29194e24 (diff)
Keep program options sorted alphabetically making them easy to find
Makes it easier to add/remove options and keep them sync'ed. Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org> Reviewed-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
Diffstat (limited to 'idlestat.c')
-rw-r--r--idlestat.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/idlestat.c b/idlestat.c
index ca49d31..624b779 100644
--- a/idlestat.c
+++ b/idlestat.c
@@ -964,23 +964,26 @@ static void version(const char *cmd)
int getoptions(int argc, char *argv[], struct program_options *options)
{
+ /* Keep options sorted alphabetically and make sure the short options
+ * are also added to the getopt_long call below
+ */
struct option long_options[] = {
{ "trace", no_argument, &options->mode, TRACE },
{ "import", no_argument, &options->mode, IMPORT },
- { "trace-file", required_argument, NULL, 'f' },
{ "baseline-trace", required_argument, NULL, 'b' },
- { "output-file", required_argument, NULL, 'o' },
+ { "idle", no_argument, NULL, 'c' },
+ { "energy-model-file", required_argument, NULL, 'e' },
+ { "trace-file", required_argument, NULL, 'f' },
{ "help", no_argument, NULL, 'h' },
+ { "output-file", required_argument, NULL, 'o' },
+ { "frequency", no_argument, NULL, 'p' },
+ { "report-format", required_argument, NULL, 'r' },
{ "duration", required_argument, NULL, 't' },
- { "version", no_argument, NULL, 'V' },
{ "verbose", no_argument, NULL, 'v' },
- { "idle", no_argument, NULL, 'c' },
- { "frequency", no_argument, NULL, 'p' },
{ "wakeup", no_argument, NULL, 'w' },
- { "energy-model-file", required_argument, NULL, 'e' },
- { "report-format", required_argument, NULL, 'r' },
- { "csv-report", no_argument, NULL, 'C' },
{ "boxless-report", no_argument, NULL, 'B' },
+ { "csv-report", no_argument, NULL, 'C' },
+ { "version", no_argument, NULL, 'V' },
{ 0, 0, 0, 0 }
};
int c;
@@ -994,7 +997,7 @@ int getoptions(int argc, char *argv[], struct program_options *options)
int optindex = 0;
- c = getopt_long(argc, argv, ":b:e:f:o:ht:r:cpwVvCB",
+ c = getopt_long(argc, argv, ":b:ce:f:ho:pr:t:vwBCV",
long_options, &optindex);
if (c == -1)
break;