Changeset View
Changeset View
Standalone View
Standalone View
src/browse/workflow/ArcanistBrowseWorkflow.php
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | EOTEXT | ||||
} | } | ||||
public function run() { | public function run() { | ||||
$conduit = $this->getConduitEngine(); | $conduit = $this->getConduitEngine(); | ||||
$console = PhutilConsole::getConsole(); | $console = PhutilConsole::getConsole(); | ||||
$targets = $this->getArgument('targets'); | $targets = $this->getArgument('targets'); | ||||
if (!$targets) { | |||||
throw new ArcanistUsageException( | |||||
pht( | |||||
'Specify one or more paths or objects to browse. Use the '. | |||||
'command "%s" if you want to browse this directory.', | |||||
'arc browse .')); | |||||
} | |||||
$targets = array_fuse($targets); | $targets = array_fuse($targets); | ||||
if (!$targets) { | if (!$targets) { | ||||
$refs = array( | $refs = array( | ||||
new ArcanistBrowseRef(), | new ArcanistBrowseRef(), | ||||
); | ); | ||||
} else { | } else { | ||||
$refs = array(); | $refs = array(); | ||||
▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | if ($many_hits) { | ||||
pht('CHOOSE'), | pht('CHOOSE'), | ||||
pht('Use "--types" to select between alternatives.')); | pht('Use "--types" to select between alternatives.')); | ||||
} | } | ||||
} | } | ||||
// If anything failed to resolve, this is also an error. | // If anything failed to resolve, this is also an error. | ||||
if ($zero_hits) { | if ($zero_hits) { | ||||
foreach ($zero_hits as $ref) { | foreach ($zero_hits as $ref) { | ||||
$token = $ref->getToken(); | |||||
if ($token === null) { | |||||
echo tsprintf( | |||||
"%s\n", | |||||
pht( | |||||
'Unable to resolve default browse target.')); | |||||
} else { | |||||
echo tsprintf( | echo tsprintf( | ||||
"%s\n", | "%s\n", | ||||
pht( | pht( | ||||
'Unable to resolve argument "%s".', | 'Unable to resolve argument "%s".', | ||||
$ref->getToken())); | $ref->getToken())); | ||||
} | } | ||||
} | |||||
foreach ($loaders as $loader) { | foreach ($loaders as $loader) { | ||||
$loader->didFailToLoadBrowseURIRefs($refs); | $loader->didFailToLoadBrowseURIRefs($refs); | ||||
} | } | ||||
} | } | ||||
$uris = array(); | $uris = array(); | ||||
foreach ($open_uris as $ref) { | foreach ($open_uris as $ref) { | ||||
Show All 20 Lines |