Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14022447
D7647.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7647.diff
View Options
Index: src/workflow/ArcanistFeatureWorkflow.php
===================================================================
--- src/workflow/ArcanistFeatureWorkflow.php
+++ src/workflow/ArcanistFeatureWorkflow.php
@@ -60,6 +60,13 @@
'by-status' => array(
'help' => 'Sort branches by status instead of time.',
),
+ 'output' => array(
+ 'param' => 'format',
+ 'support' => array(
+ 'json'
+ ),
+ 'help' => "With 'json', show features in machine-readable JSON format.",
+ ),
'*' => 'branch',
);
}
@@ -324,8 +331,10 @@
'current' => $branch['current'],
'status' => $status,
'desc' => $desc,
+ 'revision' => $revision ? $revision['id'] : null,
'color' => $color,
'esort' => $epoch,
+ 'epoch' => $epoch,
'ssort' => $ssort,
);
}
@@ -338,16 +347,22 @@
} else {
$out = isort($out, 'esort');
}
-
- $console = PhutilConsole::getConsole();
- foreach ($out as $line) {
- $color = $line['color'];
- $console->writeOut(
- "%s **%s** <fg:{$color}>%s</fg> %s\n",
- $line['current'] ? '* ' : ' ',
- str_pad($line['name'], $len_name),
- str_pad($line['status'], $len_status),
- $line['desc']);
+ if ($this->getArgument('output') == 'json') {
+ foreach ($out as &$feature) {
+ unset($feature['color'], $feature['ssort'], $feature['esort']);
+ }
+ echo json_encode(ipull($out, null, 'name')) . "\n";
+ } else {
+ $console = PhutilConsole::getConsole();
+ foreach ($out as $line) {
+ $color = $line['color'];
+ $console->writeOut(
+ "%s **%s** <fg:{$color}>%s</fg> %s\n",
+ $line['current'] ? '* ' : ' ',
+ str_pad($line['name'], $len_name),
+ str_pad($line['status'], $len_status),
+ $line['desc']);
+ }
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 5:37 PM (5 d, 8 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6753290
Default Alt Text
D7647.diff (1 KB)
Attached To
Mode
D7647: Add output-json option to arc feature
Attached
Detach File
Event Timeline
Log In to Comment