Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
csi-trace: Add --version and --help args to utility
  • Loading branch information
Bryce Harrington committed Mar 7, 2015
1 parent 3a7d411 commit c0458b4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion util/cairo-script/csi-trace.c
Expand Up @@ -2,6 +2,7 @@
#include <cairo-script-interpreter.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libgen.h>

Expand All @@ -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);
Expand Down

0 comments on commit c0458b4

Please sign in to comment.