Commit | Line | Data |
---|---|---|
86530b38 AT |
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; |