Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistInspectWorkflow.php
| Show All 15 Lines | ); | ||||
| return $this->newWorkflowInformation() | return $this->newWorkflowInformation() | ||||
| ->setSynopsis(pht('Show internal object information.')) | ->setSynopsis(pht('Show internal object information.')) | ||||
| ->addExample(pht('**inspect** [__options__] -- __object__')) | ->addExample(pht('**inspect** [__options__] -- __object__')) | ||||
| ->setHelp($help); | ->setHelp($help); | ||||
| } | } | ||||
| public function getWorkflowArguments() { | public function getWorkflowArguments() { | ||||
| return array( | return array( | ||||
| $this->newWorkflowArgument('all') | $this->newWorkflowArgument('explore') | ||||
| ->setHelp(pht('Load all object hardpoints.')), | ->setHelp(pht('Load all object hardpoints.')), | ||||
| $this->newWorkflowArgument('objects') | $this->newWorkflowArgument('objects') | ||||
| ->setWildcard(true), | ->setWildcard(true), | ||||
| ); | ); | ||||
| } | } | ||||
| public function runWorkflow() { | public function runWorkflow() { | ||||
| $is_all = $this->getArgument('all'); | $is_explore = $this->getArgument('explore'); | ||||
| $objects = $this->getArgument('objects'); | $objects = $this->getArgument('objects'); | ||||
| $inspectors = ArcanistRefInspector::getAllInspectors(); | $inspectors = ArcanistRefInspector::getAllInspectors(); | ||||
| if (!$objects) { | if (!$objects) { | ||||
| echo tsprintf( | echo tsprintf( | ||||
| "%s\n\n", | "%s\n\n", | ||||
| pht('Choose an object to inspect:')); | pht('Choose an object to inspect:')); | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | foreach ($objects as $description) { | ||||
| } | } | ||||
| $ref = $inspector->newInspectRef($arguments); | $ref = $inspector->newInspectRef($arguments); | ||||
| $ref_lists[get_class($ref)][] = $ref; | $ref_lists[get_class($ref)][] = $ref; | ||||
| $all_refs[] = $ref; | $all_refs[] = $ref; | ||||
| } | } | ||||
| if ($is_all) { | if ($is_explore) { | ||||
| foreach ($ref_lists as $ref_class => $refs) { | foreach ($ref_lists as $ref_class => $refs) { | ||||
| $ref = head($refs); | $ref = head($refs); | ||||
| $hardpoint_list = $ref->getHardpointList(); | $hardpoint_list = $ref->getHardpointList(); | ||||
| $hardpoints = $hardpoint_list->getHardpoints(); | $hardpoints = $hardpoint_list->getHardpoints(); | ||||
| if ($hardpoints) { | if ($hardpoints) { | ||||
| $hardpoint_keys = mpull($hardpoints, 'getHardpointKey'); | $hardpoint_keys = mpull($hardpoints, 'getHardpointKey'); | ||||
| ▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines | |||||