]> mj.ucw.cz Git - paperjam.git/blobdiff - parse.cc
Measure bboxes by Ghostscripting
[paperjam.git] / parse.cc
index 3719a4e5ccbf1927ccfd6495d2cedbcd88c914d0..1869b3a76ef04345ffd4d0ead54f7bbe2314eba6 100644 (file)
--- a/parse.cc
+++ b/parse.cc
@@ -459,3 +459,29 @@ void parse(const char *in, list<cmd *> &cmds)
   debug_cmds(cmds);
   instantiate(cmds);
 }
+
+void help()
+{
+  for (int i=0; cmd_table[i].name; i++)
+    {
+      const cmd_def *def = &cmd_table[i];
+      printf("%s\n", def->name);
+
+      const arg_def *arg = def->arg_defs;
+      static const char * const type_names[] = {
+       "string", "int", "double", "dimen"
+      };
+      while (arg->name)
+       {
+         printf("\t%s (%s)%s%s\n",
+           arg->name,
+           type_names[arg->type & AT_TYPE_MASK],
+           (arg->type & AT_MANDATORY) ? " [mandatory]" : "",
+           (arg->type & AT_POSITIONAL) ? " [positional]" : "");
+         arg++;
+       }
+
+       if (def->has_pipeline)
+         printf("\t{ pipeline }\n");
+    }
+}