Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDownloadWorkflow.php
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | return array( | ||||
| ), | ), | ||||
| '*' => 'argv', | '*' => 'argv', | ||||
| ); | ); | ||||
| } | } | ||||
| protected function didParseArguments() { | protected function didParseArguments() { | ||||
| $argv = $this->getArgument('argv'); | $argv = $this->getArgument('argv'); | ||||
| if (!$argv) { | if (!$argv) { | ||||
| throw new ArcanistUsageException("Specify a file to download."); | throw new ArcanistUsageException('Specify a file to download.'); | ||||
| } | } | ||||
| if (count($argv) > 1) { | if (count($argv) > 1) { | ||||
| throw new ArcanistUsageException("Specify exactly one file to download."); | throw new ArcanistUsageException('Specify exactly one file to download.'); | ||||
| } | } | ||||
| $file = reset($argv); | $file = reset($argv); | ||||
| if (!preg_match('/^F?\d+$/', $file)) { | if (!preg_match('/^F?\d+$/', $file)) { | ||||
| throw new ArcanistUsageException("Specify file by ID, e.g. F123."); | throw new ArcanistUsageException('Specify file by ID, e.g. F123.'); | ||||
| } | } | ||||
| $this->id = (int)ltrim($file, 'F'); | $this->id = (int)ltrim($file, 'F'); | ||||
| $this->saveAs = $this->getArgument('as'); | $this->saveAs = $this->getArgument('as'); | ||||
| $this->show = $this->getArgument('show'); | $this->show = $this->getArgument('show'); | ||||
| } | } | ||||
| public function requiresAuthentication() { | public function requiresAuthentication() { | ||||
| ▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines | |||||