1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-10 23:01:04 +01:00

Allow an unassigned flag to be passed to arc tasks

Summary: Returns unassigned tasks

Test Plan: Run `arc tasks`, `arc tasks --unassigned`, make sure I get the correct results

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3201

Differential Revision: https://secure.phabricator.com/D6009
This commit is contained in:
Gareth Evans 2013-05-23 10:32:41 -07:00 committed by epriestley
parent eb449a40b4
commit 4c37e6ff4a

View file

@ -52,6 +52,9 @@ EOTEXT
'help' => 'help' =>
"Only show tasks assigned to the given username, ". "Only show tasks assigned to the given username, ".
"also accepts @all to show all, default is you.", "also accepts @all to show all, default is you.",
'conflict' => array(
"unassigned" => "--owner supresses unassigned",
),
), ),
'order' => array( 'order' => array(
'param' => 'task_order', 'param' => 'task_order',
@ -63,6 +66,9 @@ EOTEXT
'param' => 'n', 'param' => 'n',
'paramtype' => 'int', 'paramtype' => 'int',
'help' => "Limit the amount of tasks outputted, default is all.", 'help' => "Limit the amount of tasks outputted, default is all.",
),
'unassigned' => array(
'help' => "Only show tasks that are not assigned (upforgrabs).",
) )
); );
} }
@ -70,13 +76,23 @@ EOTEXT
public function run() { public function run() {
$output = array(); $output = array();
$status = $this->getArgument('status'); $status = $this->getArgument('status');
$owner = $this->getArgument('owner'); $owner = $this->getArgument('owner');
$order = $this->getArgument('order'); $order = $this->getArgument('order');
$limit = $this->getArgument('limit'); $limit = $this->getArgument('limit');
$unassigned = $this->getArgument('unassigned');
if ($owner) {
$ownerPHID = $this->findOwnerPhid($owner);
} elseif ($unassigned) {
$ownerPHID = null;
} else {
$ownerPHID = $this->getUserPHID();
}
$this->tasks = $this->loadManiphestTasks( $this->tasks = $this->loadManiphestTasks(
($status == 'all' ? 'any' : $status), ($status == 'all' ? 'any' : $status),
($owner ? $this->findOwnerPhid($owner) : $this->getUserPHID()), $ownerPHID,
$order, $order,
$limit); $limit);