mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-16 20:33:20 +00:00
fix doc generator (do not convert efidisk0 to efidisk[N])
Also fix spacing in typetext generator.
This commit is contained in:
parent
1eac8b4b2c
commit
b54ad320a5
@ -1678,10 +1678,10 @@ sub schema_get_type_text {
|
|||||||
} elsif ($type eq 'integer' || $type eq 'number') {
|
} elsif ($type eq 'integer' || $type eq 'number') {
|
||||||
# NOTE: always access values as number (avoid converion to string)
|
# NOTE: always access values as number (avoid converion to string)
|
||||||
if (defined($phash->{minimum}) && defined($phash->{maximum})) {
|
if (defined($phash->{minimum}) && defined($phash->{maximum})) {
|
||||||
return "$type (" . ($phash->{minimum} + 0) . "-" .
|
return "$type (" . ($phash->{minimum} + 0) . " - " .
|
||||||
($phash->{maximum} + 0) . ")";
|
($phash->{maximum} + 0) . ")";
|
||||||
} elsif (defined($phash->{minimum})) {
|
} elsif (defined($phash->{minimum})) {
|
||||||
return "$type (" . ($phash->{minimum} + 0) . "- N)";
|
return "$type (" . ($phash->{minimum} + 0) . " - N)";
|
||||||
} elsif (defined($phash->{maximum})) {
|
} elsif (defined($phash->{maximum})) {
|
||||||
return "$type (-N - " . ($phash->{maximum} + 0) . ")";
|
return "$type (-N - " . ($phash->{maximum} + 0) . ")";
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ sub api_clone_schema {
|
|||||||
my $pd = $d->{$p};
|
my $pd = $d->{$p};
|
||||||
if ($p =~ m/^([a-z]+)(\d+)$/) {
|
if ($p =~ m/^([a-z]+)(\d+)$/) {
|
||||||
my ($name, $idx) = ($1, $2);
|
my ($name, $idx) = ($1, $2);
|
||||||
if ($idx == 0) {
|
if ($idx == 0 && defined($d->{"${name}1"})) {
|
||||||
$p = "${name}[n]";
|
$p = "${name}[n]";
|
||||||
} elsif (defined($d->{"${name}0"})) {
|
} elsif (defined($d->{"${name}0"})) {
|
||||||
next; # only handle once for -xx0, but only if -xx0 exists
|
next; # only handle once for -xx0, but only if -xx0 exists
|
||||||
@ -591,7 +591,7 @@ sub usage_str {
|
|||||||
if ($k =~ m/^([a-z]+)(\d+)$/) {
|
if ($k =~ m/^([a-z]+)(\d+)$/) {
|
||||||
my ($name, $idx) = ($1, $2);
|
my ($name, $idx) = ($1, $2);
|
||||||
next if $idx_param->{$name};
|
next if $idx_param->{$name};
|
||||||
if ($idx == 0) {
|
if ($idx == 0 && defined($prop->{"${name}1"})) {
|
||||||
$idx_param->{$name} = 1;
|
$idx_param->{$name} = 1;
|
||||||
$base = "${name}[n]";
|
$base = "${name}[n]";
|
||||||
}
|
}
|
||||||
@ -656,7 +656,7 @@ sub dump_properties {
|
|||||||
if ($k =~ m/^([a-z]+)(\d+)$/) {
|
if ($k =~ m/^([a-z]+)(\d+)$/) {
|
||||||
my ($name, $idx) = ($1, $2);
|
my ($name, $idx) = ($1, $2);
|
||||||
next if $idx_param->{$name};
|
next if $idx_param->{$name};
|
||||||
if ($idx == 0) {
|
if ($idx == 0 && defined($prop->{"${name}1"})) {
|
||||||
$idx_param->{$name} = 1;
|
$idx_param->{$name} = 1;
|
||||||
$base = "${name}[n]";
|
$base = "${name}[n]";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user