}
# format option, display type and description
-# $k: option name
-# $display_name: for example "-$k" of "<$k>", pass undef to use "$k:"
+# $name: option name
+# $display_name: for example "-$name" of "<$name>", pass undef to use "$name:"
# $phash: json schema property hash
# $format: 'asciidoc' or 'pod'
my $get_property_description = sub {
- my ($k, $display_name, $phash, $format, $hidepw) = @_;
+ my ($name, $display_name, $phash, $format, $hidepw) = @_;
my $res = '';
my $type = PVE::PodParser::schema_get_type_text($phash);
- if ($hidepw && $k eq 'password') {
+ if ($hidepw && $name eq 'password') {
$type = '';
}
if (defined($display_name)) {
$res .= "`$display_name` ";
} else {
- $res .= "`$k:` ";
+ $res .= "`$name`: ";
}
$res .= "`$type` " if $type;
$defaulttxt = " (default=$dv)";
}
- $display_name = "$k:" if !defined($display_name);
+ $display_name = "$name:" if !defined($display_name);
my $tmp = sprintf " %-10s %s$defaulttxt\n", $display_name, "$type";
my $indend = " ";
$base = "${name}[n]";
}
- $opts .= &$get_property_description($k, "-$base", $prop->{$k}, $format, $hidepw);
+ $opts .= &$get_property_description($base, "-$base", $prop->{$k}, $format, $hidepw);
if (!$prop->{$k}->{optional}) {
$args .= " " if $args;
$base = "${name}[n]";
}
- $raw .= &$get_property_description($k, undef, $phash, $format, 0);
+ $raw .= &$get_property_description($base, undef, $phash, $format, 0);
}
return $raw;
}