warn('⚠️ WARNING: This command is to be used from cli.'); $this->line(''); $type = $this->argument('type'); $renamed = $this->argument('renamed'); if (! \in_array($type, ['ama', 'add', 'ani', 'mov', 'nfo', 'tv'], true)) { $this->error('Type must be one of: ama, add, ani, mov, nfo, sha, tv'); $this->line(''); $this->line('ama => Do amazon/books processing'); $this->line('add => Do additional (rar|zip) processing'); $this->line('ani => Do anime processing'); $this->line('mov => Do movie processing'); $this->line('nfo => Do NFO processing'); $this->line('tv => Do TV processing'); return self::FAILURE; } try { $options = []; if ($renamed === 'true' || $renamed === true) { $options = [0 => true]; } (new Forking)->processWorkType('postProcess_'.$type, $options); return self::SUCCESS; } catch (\Exception $e) { $this->error($e->getMessage()); return self::FAILURE; } } }