Psh/Builtins/Hash.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 29 CC 4 SCAR 28.0
CC
4
Cov
0%
bi_hash
20.0
BEGIN
2.0
CRAP 16.4
1 package Psh::Builtins::Hash;
2  
3 require Psh::Util;
4  
5 =item * C<hash>
6  
7 Shows information about Psh's executable and path hashes.
8  
9 =item * C<hash -r>
10  
11 Empties the path and executable hashes. This might be necessary if
12 executables are renamed/removed/added while you're logged in.
13  
14 =cut
15  
16  
17 sub bi_hash {
18 my @words=@{$_[1]};
19  
20 if (@words) {
21 while (my $sub= shift @words) {
22 if (substr($sub,0,1) eq '-') {
23 if ($sub eq '-r') {
24 %Psh::Util::command_hash=();
25 %Psh::Util::path_hash=();
26 } else {
27 Psh::Util::print_out("Unknown option $sub.\n");
28 }
29 } else {
30 }
31 }
32 }
33 else {
34 while (my ($key,$val)= each %Psh::Util::command_hash) {
35 Psh::Util::print_out("$key=$val\n");
36 }
37 while (my ($key,$val)= each %Psh::Util::path_hash) {
38 Psh::Util::print_out("$key=$val\n");
39 }
40 }
41 return (1,undef);
42 }
43  
44 1;