Skip to content

Commit 7d332d5

Browse files
committed
Added askHint helper on PrettyCommandOutput
1 parent 0fc3d6a commit 7d332d5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/app/Console/Commands/Traits/PrettyCommandOutput.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,22 @@ public function deleteLines(int $amount = 1)
230230
$this->output->write(str_repeat("\033[A\33[2K\r", $amount));
231231
}
232232

233+
/**
234+
*
235+
*
236+
* @return void
237+
*/
238+
public function askHint(string $question, array $hints, string $default)
239+
{
240+
$hints = collect($hints)
241+
->map(function ($hint) {
242+
return " <fg=gray>│ $hint</>";
243+
})
244+
->join(PHP_EOL);
245+
246+
return $this->ask($question.PHP_EOL.$hints, $default);
247+
}
248+
233249
/**
234250
* Deletes one or multiple chars.
235251
*

0 commit comments

Comments
 (0)