From 77096a6fa41fe39d91fc1e1654d05718afcd5a9b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Mon, 15 May 2017 09:31:08 +0200 Subject: [PATCH] rename variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit to prevent confusion of rendered type text vs. original type property Signed-off-by: Fabian Grünbichler --- src/PVE/RESTHandler.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/PVE/RESTHandler.pm b/src/PVE/RESTHandler.pm index 119e26e..d700976 100644 --- a/src/PVE/RESTHandler.pm +++ b/src/PVE/RESTHandler.pm @@ -409,16 +409,16 @@ my $get_property_description = sub { chomp $descr; - my $type = PVE::JSONSchema::schema_get_type_text($phash, $style); + my $type_text = PVE::JSONSchema::schema_get_type_text($phash, $style); if ($hidepw && $name eq 'password') { - $type = ''; + $type_text = ''; } if ($fileparams && $phash->{type} eq 'string') { foreach my $elem (@$fileparams) { if ($name eq $elem) { - $type = ''; + $type_text = ''; last; } } @@ -438,7 +438,7 @@ my $get_property_description = sub { die "unknown style '$style'"; } - $res .= "`$type` " if $type; + $res .= "`$type_text` " if $type_text; if (defined(my $dv = $phash->{default})) { $res .= "('default =' `$dv`)"; @@ -480,7 +480,7 @@ my $get_property_description = sub { die "unknown style '$style'"; } - my $tmp = sprintf " %-10s %s$defaulttxt\n", $display_name, "$type"; + my $tmp = sprintf " %-10s %s$defaulttxt\n", $display_name, "$type_text"; my $indend = " "; $res .= Text::Wrap::wrap('', $indend, ($tmp)); @@ -558,7 +558,7 @@ sub usage_str { next if $arg_hash->{$k}; next if defined($fixed_param->{$k}); - my $type = $prop->{$k}->{type} || 'string'; + my $type_text = $prop->{$k}->{type} || 'string'; next if $hidepw && ($k eq 'password') && !$prop->{$k}->{optional}; @@ -578,7 +578,7 @@ sub usage_str { if (!$prop->{$k}->{optional}) { $args .= " " if $args; - $args .= "-$base <$type>" + $args .= "-$base <$type_text>" } } -- 2.39.2