+static void version(FILE *fp)
+ { pquis(fp, "$ (xtoys version " VERSION ")\n"); }
+
+static void usage(FILE *fp)
+ { pquis(fp, "Usage: $ [-bcx] [-d DISPLAY]\n"); }
+
+static void help(FILE *fp)
+{
+ version(fp);
+ fputc('\n', fp);
+ usage(stdout);
+ fputs("\n\
+Reads the size of the X root window and outputs it in a form suitable\n\
+for use as a shell assignment statement, defining variables XWIDTH and\n\
+XHEIGHT.\n\
+\n\
+Options:\n\
+\n\
+-h, --help Display this help text\n\
+-u, --usage Display a short usage summary\n\
+-v, --version Display the program's version number\n\
+\n\
+-d, --display=DISPLAY Choose X display to connect to\n\
+-b, --bourne-shell Output text suitable for a Bourne shell\n\
+-c, --c-shell Output text suitable for a C shell\n\
+-x, --export Export the variables into the environment\n",
+ fp);
+}
+
+static void print_var(const char *name, unsigned long value)
+{
+ if (index >= 0) {
+ dstr_putf(&d, "XSCR%d_%s", index, name);
+ name = d.buf;
+ }
+ if (flags & F_SH) {
+ printf("%s=%lu", name, value);
+ if (flags & F_EXPORT) printf("; export %s", name);
+ } else if (flags & F_CSH) {
+ if (flags & F_EXPORT) printf("setenv %s %lu", name, value);
+ else printf("set %s=%lu", name, value);
+ }
+ putchar('\n');
+ dstr_destroy(&d);
+}
+