1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-05-31 22:49:46 +02:00

Show index in examples for indexed options, i.e. repo-*, pg-*.

Suggested by Stephen Frost.
This commit is contained in:
David Steele 2018-03-06 14:20:12 -05:00
parent 45ffe37e4f
commit 4c8ed3530c
2 changed files with 15 additions and 3 deletions

View File

@ -838,6 +838,10 @@ sub helpOptionGet
# Get the example
my $strExample;
my $strOptionPrefix = $rhConfigDefine->{$strOption}{&CFGDEF_PREFIX};
my $strOptionIndex = defined($strOptionPrefix) ?
"${strOptionPrefix}1-" . substr($strOption, length($strOptionPrefix) + 1) : $strOption;
if (defined($strCommand))
{
if (docConfigOptionTypeTest($strOption, CFGDEF_TYPE_BOOLEAN))
@ -848,16 +852,16 @@ sub helpOptionGet
$$oOptionHash{&CONFIG_HELP_EXAMPLE});
}
$strExample = '--' . ($$oOptionHash{&CONFIG_HELP_EXAMPLE} eq 'n' ? 'no-' : '') . $strOption;
$strExample = '--' . ($$oOptionHash{&CONFIG_HELP_EXAMPLE} eq 'n' ? 'no-' : '') . $strOptionIndex;
}
else
{
$strExample = "--${strOption}=" . $$oOptionHash{&CONFIG_HELP_EXAMPLE};
$strExample = "--${strOptionIndex}=" . $$oOptionHash{&CONFIG_HELP_EXAMPLE};
}
}
else
{
$strExample = "${strOption}=" . $$oOptionHash{&CONFIG_HELP_EXAMPLE};
$strExample = "${strOptionIndex}=" . $$oOptionHash{&CONFIG_HELP_EXAMPLE};
}
$strCodeBlock .= (defined($strCodeBlock) ? "\n" : '') . "example: ${strExample}";

View File

@ -53,6 +53,14 @@
<release-doc-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>
<p>Remove references to the C library being optional.</p>
</release-item>