]> git.proxmox.com Git - pve-common.git/commitdiff
remove + from getopt's prefix_pattern
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 2 Sep 2015 10:09:54 +0000 (12:09 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 3 Sep 2015 09:19:28 +0000 (11:19 +0200)
Perl by default interprets + as a parameter prefix, which
means commands like `pct resize 103 rootfs +1G` error with
'Unknown option: 1g', we don't want that.

src/PVE/JSONSchema.pm

index ed1813d3bb2a66b4d2f41cc33a58f05acaa020a7..47aa2780ca9e356f382babfdf1ad10975c7261f0 100644 (file)
@@ -1082,6 +1082,8 @@ sub get_options {
        }
     }
 
        }
     }
 
+    Getopt::Long::Configure('prefix_pattern=(--|-)');
+
     my $opts = {};
     raise("unable to parse option\n", code => HTTP_BAD_REQUEST)
        if !Getopt::Long::GetOptionsFromArray($args, $opts, @getopt);
     my $opts = {};
     raise("unable to parse option\n", code => HTTP_BAD_REQUEST)
        if !Getopt::Long::GetOptionsFromArray($args, $opts, @getopt);