[tools] Add help message to sgen-grep-binprot.
authorJon Purdy <evincarofautumn@gmail.com>
Fri, 1 May 2015 20:35:38 +0000 (13:35 -0700)
committerJon Purdy <evincarofautumn@gmail.com>
Fri, 1 May 2015 22:27:58 +0000 (15:27 -0700)
tools/sgen/sgen-grep-binprot.c

index ead56195aa0a778ebf7cc25adddcfde278e0d1d6..64f3db4c2d329cd4aaa2bf0b360960b1715a3757 100644 (file)
@@ -619,6 +619,29 @@ main (int argc, char *argv[])
                } else if (!strcmp (arg, "-i") || !strcmp (arg, "--input")) {
                        input_path = next_arg;
                        ++i;
+               } else if (!strcmp (arg, "--help")) {
+                       printf (
+                               "\n"
+                               "Usage:\n"
+                               "\n"
+                               "\tsgen-grep-binprot [options] [pointer...]\n"
+                               "\n"
+                               "Examples:\n"
+                               "\n"
+                               "\tsgen-grep-binprot --all </tmp/binprot\n"
+                               "\tsgen-grep-binprot --input /tmp/binprot --color 0xdeadbeef\n"
+                               "\n"
+                               "Options:\n"
+                               "\n"
+                               "\t--all                    Print all entries.\n"
+                               "\t--color, -c              Highlight matches in color.\n"
+                               "\t--help                   You're looking at it.\n"
+                               "\t--input FILE, -i FILE    Read input from FILE instead of standard input.\n"
+                               "\t--pause-times            Print GC pause times.\n"
+                               "\t--start-at N, -s N       Begin filtering at the Nth entry.\n"
+                               "\t--vtable PTR, -v PTR     Search for vtable pointer PTR.\n"
+                               "\n");
+                       return 0;
                } else {
                        nums [num_nums++] = strtoul (arg, NULL, 16);
                }