Psh/Support/Alias.pm untested

filter: Statementstmt 0.0% 0 / 11 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 20 CC 2 SCAR 12.8
CC
2
Cov
0%
is_aliased
6.0
_is_aliases
2.0
get_alias_commands
2.0
CRAP 3.6
1 package Psh::Support::Alias;
2  
3 use strict;
4  
5 $Psh::Support::Alias::loaded=1;
6  
7 %Psh::Support::Alias::aliases=();
8  
9 #
10 # bool _is_aliased( string COMMAND )
11 #
12 # returns TRUE if COMMAND is aliased:
13  
14 sub is_aliased {
15 my $command = shift;
16 if (exists($Psh::Support::Alias::aliases{$command})) { return 1; }
17 return 0;
18 }
19  
20 #backwards compatibility
21 sub _is_aliases {
22 return is_aliases(@_);
23 }
24  
25 # Returns a list of aliases commands
26 sub get_alias_commands {
27 return keys %Psh::Support::Alias::aliases;
28 }
29  
30 1;