+ $cli_options = getopt("em:u:h", array("help"));
+ foreach ($cli_options as $opt => $val) {
+ switch ($opt) {
+ case 'e':
+ $options['generate_enclosure'] = TRUE;
+ break;
+
+ case 'm':
+ $ret = filter_var($val, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
+ if (NULL === $ret) {
+ fwrite(STDERR, "Invalid argument for the -m option.\n");
+ fwrite(STDERR, usage($argv));
+ exit(1);
+ }
+ $options['show_multimedia'] = $val;
+ break;
+
+ case 'u':
+ $ret = filter_var($val, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
+ if (NULL === $ret) {
+ fwrite(STDERR, "Invalid argument for the -u option.\n");
+ fwrite(STDERR, usage($argv));
+ exit(1);
+ }
+ $options['show_usernames'] = $val;
+ break;
+
+ case 'h':
+ case 'help':
+ echo usage($argv);
+ exit(0);
+
+ default:
+ fwrite(STDERR, usage($argv));
+ exit(1);
+ }
+ }