1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-21 22:32:41 +01:00

Support short aliases and repeatable arguments in Arcanist Workflow arguments

Summary: Ref T13546. Add support for short "-x" flags and repeatable "--say moo --say quack" flags.

Test Plan: In future changes, used "arc diff -m" and "arc land --onto ... --onto ...".

Maniphest Tasks: T13546

Differential Revision: https://secure.phabricator.com/D21310
This commit is contained in:
epriestley 2020-06-04 09:41:58 -07:00
parent 7c80a9006d
commit 6af46f289a

View file

@ -8,6 +8,8 @@ final class ArcanistWorkflowArgument
private $wildcard;
private $parameter;
private $isPathArgument;
private $shortFlag;
private $repeatable;
public function setKey($key) {
$this->key = $key;
@ -27,6 +29,24 @@ final class ArcanistWorkflowArgument
return $this->wildcard;
}
public function setShortFlag($short_flag) {
$this->shortFlag = $short_flag;
return $this;
}
public function getShortFlag() {
return $this->shortFlag;
}
public function setRepeatable($repeatable) {
$this->repeatable = $repeatable;
return $this;
}
public function getRepeatable() {
return $this->repeatable;
}
public function getPhutilSpecification() {
$spec = array(
'name' => $this->getKey(),
@ -46,6 +66,16 @@ final class ArcanistWorkflowArgument
$spec['help'] = $help;
}
$short = $this->getShortFlag();
if ($short !== null) {
$spec['short'] = $short;
}
$repeatable = $this->getRepeatable();
if ($repeatable !== null) {
$spec['repeat'] = $repeatable;
}
return $spec;
}