# Pastebin Dsx4swqV use Selkie::UI; $*ERR = $*OUT = open "log.log", :w; grammar Mod { token TOP { * } token name { [<-[<:>]>+]+ % "::" } token par { ":" "<" ~ ">" $=[.+?] } } my $proc = run , :out; my @lines = $proc.out.lines; my @distros = @lines.map: { given Mod.parse: $_ { quietly ~. => %( ..map: { ~. => ~. } ) } } my %list = @distros.classify: *.key, :as{ .value<> } my @items = %list.keys.sort.grep: *.so; App { my @names := new-array-state @items; my @selected := new-array-state %list{@items.head}; my @auth-sel := new-array-state @selected.grep({ . eq @selected.head }).unique; HBox { VBox { Border :title, :3size, { TextInput(:1size).on-change: -> $, Str $text { @names = |@items.grep: *.contains: $text } } Border :title, { ListView(:select-first, { @names }).focus.on-select: -> $, $text { @selected = %list{ $text } } } } Border :title, { ListView(:select-first, { @selected.map(*).unique }).on-select: -> $, $text { @auth-sel = @selected.grep: { . eq $text } } } Border :title, { ListView :select-first, { @auth-sel.map({ "{ ":ver<{ .Str }>" with . }{ ":api<{ .Str }>" with .}" }).sort.unique.reverse } } } }