]> git.proxmox.com Git - pve-client.git/commitdiff
add split_args helper
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 24 May 2018 09:06:15 +0000 (11:06 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 24 May 2018 09:06:15 +0000 (11:06 +0200)
PVE/Tools.pm

index dddf1c08416a4bf3680de30abaea411e29b9dbbb..2d0b7276037b28a83559252d86d86e81235eb185 100644 (file)
@@ -6,6 +6,7 @@ use POSIX qw(EINTR EEXIST EOPNOTSUPP);
 use base 'Exporter';
 
 use IO::File;
 use base 'Exporter';
 
 use IO::File;
+use Text::ParseWords;
 
 our @EXPORT_OK = qw(
 $IPV6RE
 
 our @EXPORT_OK = qw(
 $IPV6RE
@@ -126,4 +127,11 @@ sub split_list {
     return @data;
 }
 
     return @data;
 }
 
+# split an shell argument string into an array,
+sub split_args {
+    my ($str) = @_;
+
+    return $str ? [ Text::ParseWords::shellwords($str) ] : [];
+}
+
 1;
 1;