Psh/Builtins/Exit.pm untested

filter: Statementstmt 0.0% 0 / 6 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 1 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 17 CC 3 SCAR 24.8
CC
3
Cov
0%
bi_exit
12.0
CRAP 12.0
1 package Psh::Builtins::Exit;
2  
3 =item * C<exit>
4  
5 Exit out of the shell.
6  
7 =cut
8  
9 #
10 # TODO: What if a string is passed in?
11 #
12  
13 sub bi_exit
14 {
15 my $result = shift;
16 $result = 0 unless defined($result) && $result;
17  
18 my $file= Psh::OS::catfile(Psh::OS::get_home_dir(),".${Psh::bin}_logout");
19 if( -r $file) {
20 process_file(abs_path($file));
21 }
22  
23 Psh::OS::exit_psh($result);
24 }
25  
26 1;