Open srchulo opened 5 years ago
Whoops, looks like this may actually show more than the one when $num > 0
, and none when $num == 0
. However, I had $num set to50,000
, and it was not very readable due to the large number.
I currently did this as a work around:
if ($doit->is_dry_run) {
info "Dry run, next set of statements will run in a loop from the number returned above. You will only see one set now.";
info "-----------------------------------";
$num = 1;
}
for (0..$num) {
$doit->run();
}
if ($doit->is_dry_run) {
info "-----------------------------------";
}
It would be really cool if Doit supported loops/iteration. Currently if I have:
The
--dry-run
output will only show the items in the loop once. It would be nice if there was something like:Then the output could maybe show something like "running this command from 0 to x" and the
INFO
logs could maybe be indented to indicate a loop?. I called the above range, because for numbers you may want to show the range you're running over instead of all possibilities, but for a generalloop
orforeach
may want to show each of the items.