+
+//command line option parsing
+$optind = null;
+$opts = getopt('h', ['help', 'mini', 'noqr'], $optind);
+$args = array_slice($argv, $optind);
+
+if (isset($opts['help']) || isset($opts['h'])) {
+ echo "Import games from a OUYA game data repository\n";
+ echo "\n";
+ echo "Usage: import-game-data.php [--mini] [--noqr] [--help|-h]\n";
+ echo " --mini Generate small but ugly JSON files\n";
+ echo " --noqr Do not generate and link QR code images\n";
+ exit(0);
+}
+
+if (!isset($args[0])) {