Add json plugin for machine parseable output

This commit is contained in:
Juerd Waalboer 2022-01-19 17:37:37 +01:00
parent ec521aef7d
commit ec2092ba1b
2 changed files with 90 additions and 1 deletions

View file

@ -20,6 +20,7 @@ sub command :Tab(help,wtf,omgwtfbbq) ($self, $cart, $command, @) {
# On the other hand, busybox(1) has a "more" applet that gives the user
# clear instructions and seems mostly harmless too.
my $pipe;
my $oldhandle = select;
if (open $pipe, "|-", "busybox", "more") {
select $pipe;
}
@ -49,7 +50,7 @@ ${bold}Advanced usage:${off} pass space separated arguments to parameters
Complete each transaction with ${underline}account${off} (i.e. enter your name).
END
select STDOUT;
select $oldhandle;
close $pipe;
return ACCEPT;