+#include <uobject/uobject.h>
+#include <uobject/exportable.h>
+#include <uobject/loadable.h>
+#include <uobject/module.h>
+
+enum {
+ MODE_INFO,
+ MODE_EXPORT,
+ MODE_MAX
+};
+
+int verbose = 0;
+
+static const char *progname = "upkg";
+static const char *sopts = "ixvVH";
+static const struct option lopts[] = {
+ { "info", 0, NULL, 'i' },
+ { "export", 0, NULL, 'x' },
+ { "verbose", 0, NULL, 'v' },
+ { "version", 0, NULL, 'V' },
+ { "help", 0, NULL, 'H' },
+ { 0 }
+};
+
+void print_version(void)
+{
+ printf("%s\n", PACKAGE_STRING);
+ puts("\
+Copyright (C) 2009 Nick Bowler.\n\
+This is free software: you are free to change and redistribute it.\n\
+There is NO WARRANTY, to the extent permitted by law."
+ );
+}
+
+void print_usage(FILE *f)
+{
+ fprintf(f, "Usage: %s [options] package\n", progname);
+}
+
+void print_help(void)
+{
+ print_usage(stdout);
+ puts("Detailed help coming soon. Until then, I'll just list my options.");
+ for (unsigned i = 0; lopts[i].name; i++) {
+ const struct option *o = &lopts[i];
+ printf("\t--%s", o->name);
+
+ if (o->has_arg == 1) {
+ printf("=val");
+ } else if (o->has_arg == 2) {
+ printf("[=val]");
+ }
+
+ printf(" (-%c)\n", o->val);
+ }
+}