summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Harrington <b.harrington@samsung.com>2015-03-06 23:31:25 -0800
committerBryce Harrington <b.harrington@samsung.com>2015-03-06 23:35:34 -0800
commitc0458b456007f718747be7fd690e674df5026059 (patch)
treef75c54998e6b19760f44dec0890964c5b5925164
parent3a7d411539975728f90b7d0bb55e3bee2e8600bb (diff)
csi-trace: Add --version and --help args to utility
-rw-r--r--util/cairo-script/csi-trace.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/util/cairo-script/csi-trace.c b/util/cairo-script/csi-trace.c
index c57a56b18..a0466a35b 100644
--- a/util/cairo-script/csi-trace.c
+++ b/util/cairo-script/csi-trace.c
@@ -2,6 +2,7 @@
#include <cairo-script-interpreter.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <libgen.h>
@@ -22,11 +23,18 @@ main (int argc, char **argv)
.surface_create = _script_surface_create,
};
int i;
+ char buf[4096];
csi = cairo_script_interpreter_create ();
for (i = 1; i < argc; i++) {
- char buf[4096];
+ if (strcmp (argv[i], "--version")) {
+ printf ("%s: version %s\n", argv[0], __DATE__);
+ exit (0);
+ } else if (strcmp (argv[i], "--help")) {
+ printf ("usage: %s < in > out\n", argv[0]);
+ exit (0);
+ }
snprintf (buf, sizeof (buf), "%s.trace", basename (argv[i]));
cairo_device_destroy (hooks.closure);