use Term::ReadLine;
use Devel::Dwarn;
use Sub::Quote;
+use YAML ();
+use Safe::Isa;
my $solver = DX::Solver->new(observation_policy => sub { 1 });
sub show {
$r = ($res->isa('DX::Result') ? $res : $res->next);
unless ($r) { warn "false\n"; return; }
- Dwarn(map {
- my @act = $_->actions;
- ((@act ? \@act : ()), $_->all_values);
- } $r);
+ if (my @act = $r->actions) {
+ warn YAML::Dump([ map $_->as_structure, @act ]);
+ }
+ my $values = $r->all_values;
+ unless (keys %$values) {
+ warn "---\ntrue\n"; return;
+ }
+ warn YAML::Dump({
+ map +($_ => ($values->{$_}->$_does('DX::Role::Set')
+ ? [ $values->{$_}->all ]
+ : $values->{$_} )),
+ keys %$values
+ });
}
sub do_query {
];
return;
});
+
+$tcl->CreateCommand(n => \&show);
#$tcl->Eval(q{query D {directory_at D 't'; mode D '0755'; }});