revbank/plugins/restart
Juerd Waalboer 4f0954b2dc restart: only suppress warnings of the 'exec' category
"Statement unlikely to be reached" is the expected warning here.
2023-11-02 03:12:26 +01:00

24 lines
557 B
Perl

#!perl
HELP "restart" => "Attempt to restart the RevBank shell";
sub command :Tab(restart) ($self, $cart, $command, @) {
return NEXT if $command ne 'restart';
call_hooks("restart_exec");
no warnings qw(exec);
exec $0;
call_hooks("restart_survived");
return ABORT, "exec() failed. You'll have to restart revbank yourself :P";
}
sub hook_input($class, $cart, $input, $split_input, @) {
return if defined $input;
call_hooks("restart_restart");
no warnings qw(exec);
exec $0;
call_hooks("restart_survived");
}