1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-12-23 23:51:07 +02:00

Implemented issue #132: Improved command-line help.

Implemented issue #133: Dynamic module loading where possible.
This commit is contained in:
David Steele
2015-09-08 07:31:24 -04:00
parent 0913072c45
commit ac3c0d43ab
49 changed files with 3331 additions and 838 deletions

View File

@@ -190,4 +190,38 @@ sub timestampFileFormat
push @EXPORT, qw(timestampFileFormat);
####################################################################################################################################
# stringSplit
####################################################################################################################################
sub stringSplit
{
my $strString = shift;
my $strChar = shift;
my $iLength = shift;
if (length($strString) <= $iLength)
{
return $strString, undef;
}
my $iPos = index($strString, $strChar);
if ($iPos == -1)
{
return $strString, undef;
}
my $iNewPos = $iPos;
while ($iNewPos != -1 && $iNewPos + 1 < $iLength)
{
$iPos = $iNewPos;
$iNewPos = index($strString, $strChar, $iPos + 1);
}
return substr($strString, 0, $iPos + 1), substr($strString, $iPos + 1);
}
push @EXPORT, qw(stringSplit);
1;