Skip to content

Commit

Permalink
[BUGS-7496] Paging true in workflow:list depending on new all flag. (#…
Browse files Browse the repository at this point in the history
…2543)

* Paging true in workflow:list.

* Add all option to workflow:list.

* Reword help text.
  • Loading branch information
kporras07 authored Feb 27, 2024
1 parent 8033569 commit 4e84ee1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Commands/Workflow/ListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class ListCommand extends TerminusCommand implements SiteAwareInterface
* @command workflow:list
* @aliases workflows
*
* @option bool $all Return all of the available workflows, not just the most recent 100
*
* @field-labels
* id: Workflow ID
* env: Environment
Expand All @@ -40,11 +42,14 @@ class ListCommand extends TerminusCommand implements SiteAwareInterface
*
* @usage <site> Displays the list of the workflows for <site>.
*/
public function wfList($site_id)
public function wfList($site_id, $options = [
'all' => false,
])
{
$paging = (bool) $options['all'];
$site = $this->getSiteById($site_id);
return $this->getRowsOfFields(
$site->getWorkflows()->setPaging(false)->fetch(),
$site->getWorkflows()->setPaging($paging)->fetch(),
[
'message' => 'No workflows have been run on {site}.',
'message_options' => ['site' => $site->getName()],
Expand Down

0 comments on commit 4e84ee1

Please sign in to comment.