Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
mantas6 committed Dec 31, 2024
1 parent ee4e405 commit 891be68
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Commands\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Output\BufferedOutput;

use function Mantas6\FzfPhp\fzf;
use function Termwind\render;

class InspireCommand extends Command
Expand All @@ -28,6 +31,26 @@ class InspireCommand extends Command
*/
public function handle(): void
{
$out = new BufferedOutput;
$table = new Table($out);

$rows = [
[ 'title' => 'Oranges', 'id' => "\t1"],
[ 'title' => 'Apples', 'id' => "\t2"],
[ 'title' => 'Grapefruit', 'id' => "\t3"],
];

$table->setStyle('compact')
->setRows($rows)
->render();

$str = $out->fetch();

$result = fzf(
explode(PHP_EOL, $str),
['d' => "\t", 'with-nth' => '1'],
);

dd($result);
}
}

0 comments on commit 891be68

Please sign in to comment.