mirror of
				https://codeberg.org/h3xx/simplify_static_dir
				synced 2024-08-14 23:57:24 +00:00 
			
		
		
		
	Unpack @_ first (PBP)
This commit is contained in:
		
							parent
							
								
									907a7113a8
								
							
						
					
					
						commit
						7dbbb5422a
					
				
					 8 changed files with 28 additions and 22 deletions
				
			
		|  | @ -6,8 +6,7 @@ require Cwd; | |||
| use File::Basename qw/ dirname /; | ||||
| 
 | ||||
| sub new { | ||||
|     my $class = shift; | ||||
|     my $rel_name = shift; | ||||
|     my ($class, $rel_name) = @_; | ||||
|     my $self = bless { | ||||
|         rel_name => $rel_name, | ||||
|         name => Cwd::abs_path($rel_name), | ||||
|  |  | |||
|  | @ -13,11 +13,11 @@ require Directory::Simplify::File; | |||
| # :squash-remove-end: | ||||
| 
 | ||||
| sub new { | ||||
|     my $class = shift; | ||||
|     my ($class, %args) = @_; | ||||
|     return bless { | ||||
|         _entries => {}, | ||||
|         _files_in_hash => {}, | ||||
|         @_, | ||||
|         %args, | ||||
|     }, $class; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -9,9 +9,9 @@ require Directory::Simplify::Utils; | |||
| # :squash-remove-end: | ||||
| 
 | ||||
| sub new { | ||||
|     my $class = shift; | ||||
|     my ($class, %args) = @_; | ||||
|     return bless { | ||||
|         @_, | ||||
|         %args, | ||||
|     }, $class; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -11,11 +11,11 @@ require Directory::Simplify::Instruction::Hardlink; | |||
| # :squash-remove-end: | ||||
| 
 | ||||
| sub new { | ||||
|     my $class = shift; | ||||
|     my ($class, %args) = @_; | ||||
|     return bless { | ||||
|         filehash => undef, | ||||
|         min_size => 1, | ||||
|         @_, | ||||
|         %args, | ||||
|     }, $class; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -9,10 +9,10 @@ require Directory::Simplify::Utils; | |||
| # :squash-remove-end: | ||||
| 
 | ||||
| sub new { | ||||
|     my $class = shift; | ||||
|     my ($class, %args) = @_; | ||||
|     return bless { | ||||
|         freed => 0, | ||||
|         @_, | ||||
|         %args, | ||||
|     }, $class; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -4,8 +4,9 @@ use strict; | |||
| use warnings; | ||||
| 
 | ||||
| sub addcommas { | ||||
|     my @numbers = @_; | ||||
|     my @added; | ||||
|     foreach my $num (@_) { | ||||
|     foreach my $num (@numbers) { | ||||
|         # don't split anything after the decimal | ||||
|         my @parts = split /\./, $num; | ||||
|         while ($parts[0] =~ s/(\d)(\d{3}(?:\D|$))/$1,$2/) { | ||||
|  | @ -36,11 +37,12 @@ sub hr_size { | |||
| 
 | ||||
| sub shell_quote { | ||||
|     # shell-escape argument for inclusion in non-interpolated single quotes | ||||
|     my @words = @_; | ||||
|     my @transformed = map { | ||||
|         (my $out = $_) | ||||
|             =~ s/'/'\\''/g; | ||||
|         "'$out'"; | ||||
|     } @_; | ||||
|     } @words; | ||||
|     wantarray ? @transformed : $transformed[0]; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue