mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-04 23:07:27 +02:00
Show index in examples for indexed options, i.e. repo-*, pg-*.
Suggested by Stephen Frost.
This commit is contained in:
parent
45ffe37e4f
commit
4c8ed3530c
@ -838,6 +838,10 @@ sub helpOptionGet
|
|||||||
# Get the example
|
# Get the example
|
||||||
my $strExample;
|
my $strExample;
|
||||||
|
|
||||||
|
my $strOptionPrefix = $rhConfigDefine->{$strOption}{&CFGDEF_PREFIX};
|
||||||
|
my $strOptionIndex = defined($strOptionPrefix) ?
|
||||||
|
"${strOptionPrefix}1-" . substr($strOption, length($strOptionPrefix) + 1) : $strOption;
|
||||||
|
|
||||||
if (defined($strCommand))
|
if (defined($strCommand))
|
||||||
{
|
{
|
||||||
if (docConfigOptionTypeTest($strOption, CFGDEF_TYPE_BOOLEAN))
|
if (docConfigOptionTypeTest($strOption, CFGDEF_TYPE_BOOLEAN))
|
||||||
@ -848,16 +852,16 @@ sub helpOptionGet
|
|||||||
$$oOptionHash{&CONFIG_HELP_EXAMPLE});
|
$$oOptionHash{&CONFIG_HELP_EXAMPLE});
|
||||||
}
|
}
|
||||||
|
|
||||||
$strExample = '--' . ($$oOptionHash{&CONFIG_HELP_EXAMPLE} eq 'n' ? 'no-' : '') . $strOption;
|
$strExample = '--' . ($$oOptionHash{&CONFIG_HELP_EXAMPLE} eq 'n' ? 'no-' : '') . $strOptionIndex;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$strExample = "--${strOption}=" . $$oOptionHash{&CONFIG_HELP_EXAMPLE};
|
$strExample = "--${strOptionIndex}=" . $$oOptionHash{&CONFIG_HELP_EXAMPLE};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$strExample = "${strOption}=" . $$oOptionHash{&CONFIG_HELP_EXAMPLE};
|
$strExample = "${strOptionIndex}=" . $$oOptionHash{&CONFIG_HELP_EXAMPLE};
|
||||||
}
|
}
|
||||||
|
|
||||||
$strCodeBlock .= (defined($strCodeBlock) ? "\n" : '') . "example: ${strExample}";
|
$strCodeBlock .= (defined($strCodeBlock) ? "\n" : '') . "example: ${strExample}";
|
||||||
|
@ -53,6 +53,14 @@
|
|||||||
|
|
||||||
<release-doc-list>
|
<release-doc-list>
|
||||||
<release-improvement-list>
|
<release-improvement-list>
|
||||||
|
<release-item>
|
||||||
|
<release-item-contributor-list>
|
||||||
|
<release-item-ideator id="frost.stephen"/>
|
||||||
|
</release-item-contributor-list>
|
||||||
|
|
||||||
|
<p>Show index in examples for indexed options, i.e. <id>repo-*</id>, <id>pg-*</id>.</p>
|
||||||
|
</release-item>
|
||||||
|
|
||||||
<release-item>
|
<release-item>
|
||||||
<p>Remove references to the C library being optional.</p>
|
<p>Remove references to the C library being optional.</p>
|
||||||
</release-item>
|
</release-item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user