diff options
author | Matthew Fischer <matthew.fischer@canonical.com> | 2013-03-09 15:42:59 -0700 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2013-03-18 13:59:37 +0100 |
commit | 0e999edff869bc08522a6a56c69efa9b5e1c33b5 (patch) | |
tree | b445aa753ee61812a4c3741ced349339fc4a680a | |
parent | 592f5944239debfa3dacc410f675261947156baf (diff) |
Adding a simple usage statement to cairo-perf-chart
Signed-off-by: Uli Schlachter <psychon@znc.in>
-rw-r--r-- | perf/cairo-perf-chart.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/perf/cairo-perf-chart.c b/perf/cairo-perf-chart.c index 5a41d029..1faa964f 100644 --- a/perf/cairo-perf-chart.c +++ b/perf/cairo-perf-chart.c @@ -999,6 +999,31 @@ add_legend (struct chart *chart) } } +static void +usage (void) +{ + printf("Usage:\n"); + printf(" cairo-perf-chart [OPTION...] <result1> <result2>...<resultN>\n"); + printf("\n"); + printf("Help Options:\n"); + printf(" --help, --?\tShow help options\n"); + printf("\n"); + printf("Application Options:\n"); + printf(" --html\tOutput an HTML table comparing the results\n"); + printf(" --height=\tSet the height of the output graph"\ + " (default 480)\n"); + printf(" --width=\tSet the width of the output graph"\ + " (default 640)\n"); + printf(" --name\tSet the name of graph series."\ + " This only sets the name for the\n\t\tfirst result file."\ + " The graph series is usually set using the\n\t\tfile name for"\ + " the results file.\n"); + printf("\n"); + printf("Example:\n"); + printf(" cairo-perf-chart --width=1024 --height=768 run1 run2 run3\n"); + return; +} + int main (int argc, const char *argv[]) @@ -1028,6 +1053,10 @@ main (int argc, chart.names[chart.num_reports] = argv[++i]; } else if (strncmp (argv[i], "--name=", 7) == 0) { chart.names[chart.num_reports] = argv[i] + 7; + } else if ((strcmp (argv[i], "--help") == 0) || + (strcmp (argv[i], "--?") == 0)) { + usage(); + return 0; } else { cairo_perf_report_load (&chart.reports[chart.num_reports++], argv[i], i, |