1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +02:00

Rename -no to -reset for non-boolean options.

This commit is contained in:
David Steele 2018-02-06 11:26:06 -05:00
parent 808b6000eb
commit 7d13087c4b
22 changed files with 473 additions and 386 deletions

View File

@ -124,7 +124,7 @@ sub buildConfig
my $iCommandTotal = 0;
my $strBuildSource =
'ConfigCommandData configCommandData[' . BLDLCL_CONSTANT_COMMAND_TOTAL . "] = CONFIG_COMMAND_LIST\n" .
'static ConfigCommandData configCommandData[' . BLDLCL_CONSTANT_COMMAND_TOTAL . "] = CONFIG_COMMAND_LIST\n" .
"(";
foreach my $strCommand (cfgDefineCommandList())
@ -164,7 +164,7 @@ sub buildConfig
my $iOptionTotal = 0;
$strBuildSource =
'ConfigOptionData configOptionData[' . BLDLCL_CONSTANT_OPTION_TOTAL . "] = CONFIG_OPTION_LIST\n" .
'static ConfigOptionData configOptionData[' . BLDLCL_CONSTANT_OPTION_TOTAL . "] = CONFIG_OPTION_LIST\n" .
"(";
foreach my $strOption (sort(keys(%{$rhConfigDefine})))

View File

@ -367,7 +367,7 @@ sub buildConfigDefine
my $rhEnum = $rhBuild->{&BLD_FILE}{&BLDLCL_FILE_DEFINE}{&BLD_ENUM}{&BLDLCL_ENUM_COMMAND};
my $strBuildSource =
"ConfigDefineCommandData configDefineCommandData[] = CFGDEFDATA_COMMAND_LIST\n" .
"static ConfigDefineCommandData configDefineCommandData[] = CFGDEFDATA_COMMAND_LIST\n" .
"(";
foreach my $strCommand (cfgDefineCommandList())
@ -438,7 +438,7 @@ sub buildConfigDefine
$rhEnum = $rhBuild->{&BLD_FILE}{&BLDLCL_FILE_DEFINE}{&BLD_ENUM}{&BLDLCL_ENUM_OPTION};
$strBuildSource =
"ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST\n" .
"static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST\n" .
"(";
foreach my $strOption (sort(keys(%{$rhConfigDefine})))
@ -473,7 +473,6 @@ sub buildConfigDefine
" CFGDEFDATA_OPTION_INTERNAL(" . ($rhOption->{&CFGDEF_INTERNAL} ? 'true' : 'false') . ")\n" .
"\n" .
" CFGDEFDATA_OPTION_INDEX_TOTAL(" . $rhOption->{&CFGDEF_INDEX_TOTAL} . ")\n" .
" CFGDEFDATA_OPTION_NEGATE(" . ($rhOption->{&CFGDEF_NEGATE} ? 'true' : 'false') . ")\n" .
" CFGDEFDATA_OPTION_SECURE(" . ($rhOption->{&CFGDEF_SECURE} ? 'true' : 'false') . ")\n";
if (defined($hOptionHelp))

View File

@ -146,6 +146,17 @@ sub buildConfigParse
" .val = ${strOptionFlag} PARSE_NEGATE_FLAG | ${strOptionVal},\n" .
" },\n";
}
# Add reset when defined
if ($rhOption->{&CFGDEF_RESET} &&
!($iOptionNameIdx > 0 && defined($rhNameAlt->{&CFGDEF_RESET}) && !$rhNameAlt->{&CFGDEF_RESET}))
{
$strBuildSource .=
" {\n" .
" .name = \"reset-${strOptionNameOut}\",\n" .
" .val = ${strOptionFlag} PARSE_RESET_FLAG | ${strOptionVal},\n" .
" },\n";
}
}
}
}

View File

@ -37,6 +37,9 @@
# The option can be negated with "no" e.g. --no-compress. This applies tp options that are only valid on the command line (i.e.
# no config section defined). All config options are automatically negatable.
#
# CFGDEF_RESET:
# The option can be reset to default even if the default is undefined.
#
# CFGDEF_DEPEND:
# Specify the dependencies this option has on another option. All commands listed for this option must also be listed in the
# dependent option(s).
@ -464,6 +467,8 @@ use constant CFGDEF_COMMAND => 'command'
push @EXPORT, qw(CFGDEF_COMMAND);
use constant CFGDEF_REQUIRED => 'required';
push @EXPORT, qw(CFGDEF_REQUIRED);
use constant CFGDEF_RESET => 'reset';
push @EXPORT, qw(CFGDEF_RESET);
use constant CFGDEF_SECTION => 'section';
push @EXPORT, qw(CFGDEF_SECTION);
use constant CFGDEF_SECURE => 'secure';
@ -1178,7 +1183,7 @@ my %hConfigDefine =
},
&CFGDEF_NAME_ALT =>
{
'repo-cipher-pass' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-cipher-pass' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
},
@ -1197,7 +1202,7 @@ my %hConfigDefine =
],
&CFGDEF_NAME_ALT =>
{
'repo-cipher-type' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-cipher-type' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
},
@ -1228,7 +1233,7 @@ my %hConfigDefine =
&CFGDEF_REQUIRED => false,
&CFGDEF_NAME_ALT =>
{
'backup-host' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'backup-host' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND =>
{
@ -1272,7 +1277,7 @@ my %hConfigDefine =
&CFGDEF_REQUIRED => false,
&CFGDEF_NAME_ALT =>
{
'backup-cmd' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'backup-cmd' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND =>
{
@ -1300,7 +1305,7 @@ my %hConfigDefine =
&CFGDEF_DEFAULT => CFGDEF_DEFAULT_CONFIG,
&CFGDEF_NAME_ALT =>
{
'backup-config' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'backup-config' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND => CFGOPT_REPO_HOST_CMD,
&CFGDEF_DEPEND =>
@ -1318,7 +1323,7 @@ my %hConfigDefine =
&CFGDEF_REQUIRED => false,
&CFGDEF_NAME_ALT =>
{
'backup-ssh-port' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'backup-ssh-port' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND => CFGOPT_REPO_HOST_CMD,
&CFGDEF_DEPEND =>
@ -1336,7 +1341,7 @@ my %hConfigDefine =
&CFGDEF_DEFAULT => 'pgbackrest',
&CFGDEF_NAME_ALT =>
{
'backup-user' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'backup-user' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND => CFGOPT_REPO_HOST_CMD,
&CFGDEF_REQUIRED => false,
@ -1355,7 +1360,7 @@ my %hConfigDefine =
&CFGDEF_DEFAULT => '/var/lib/' . BACKREST_EXE,
&CFGDEF_NAME_ALT =>
{
'repo-path' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-path' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
},
@ -1373,7 +1378,7 @@ my %hConfigDefine =
},
&CFGDEF_NAME_ALT =>
{
'repo-s3-bucket' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-s3-bucket' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
},
@ -1383,7 +1388,7 @@ my %hConfigDefine =
&CFGDEF_INHERIT => CFGOPT_REPO_S3_HOST,
&CFGDEF_NAME_ALT =>
{
'repo-s3-ca-file' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-s3-ca-file' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
},
@ -1392,7 +1397,7 @@ my %hConfigDefine =
&CFGDEF_INHERIT => CFGOPT_REPO_S3_HOST,
&CFGDEF_NAME_ALT =>
{
'repo-s3-ca-path' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-s3-ca-path' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
},
@ -1411,7 +1416,7 @@ my %hConfigDefine =
},
&CFGDEF_NAME_ALT =>
{
'repo-s3-key' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-s3-key' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
},
@ -1421,7 +1426,7 @@ my %hConfigDefine =
&CFGDEF_INHERIT => CFGOPT_REPO_S3_KEY,
&CFGDEF_NAME_ALT =>
{
'repo-s3-key-secret' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-s3-key-secret' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
},
@ -1430,7 +1435,7 @@ my %hConfigDefine =
&CFGDEF_INHERIT => CFGOPT_REPO_S3_BUCKET,
&CFGDEF_NAME_ALT =>
{
'repo-s3-endpoint' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-s3-endpoint' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
},
@ -1444,7 +1449,7 @@ my %hConfigDefine =
&CFGDEF_DEPEND => CFGOPT_REPO_S3_BUCKET,
&CFGDEF_NAME_ALT =>
{
'repo-s3-host' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-s3-host' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND => CFGOPT_REPO_TYPE,
},
@ -1454,7 +1459,7 @@ my %hConfigDefine =
&CFGDEF_INHERIT => CFGOPT_REPO_S3_BUCKET,
&CFGDEF_NAME_ALT =>
{
'repo-s3-region' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-s3-region' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
},
@ -1488,7 +1493,7 @@ my %hConfigDefine =
],
&CFGDEF_NAME_ALT =>
{
'repo-type' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'repo-type' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
},
&CFGDEF_COMMAND =>
{
@ -1893,8 +1898,8 @@ my %hConfigDefine =
&CFGDEF_REQUIRED => false,
&CFGDEF_NAME_ALT =>
{
'db-host' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'db?-host' => {&CFGDEF_NEGATE => false},
'db-host' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
'db?-host' => {&CFGDEF_RESET => false},
},
&CFGDEF_COMMAND =>
{
@ -1930,8 +1935,8 @@ my %hConfigDefine =
&CFGDEF_REQUIRED => false,
&CFGDEF_NAME_ALT =>
{
'db-cmd' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'db?-cmd' => {&CFGDEF_NEGATE => false},
'db-cmd' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
'db?-cmd' => {&CFGDEF_RESET => false},
},
&CFGDEF_COMMAND =>
{
@ -1958,8 +1963,8 @@ my %hConfigDefine =
&CFGDEF_REQUIRED => true,
&CFGDEF_NAME_ALT =>
{
'db-config' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'db?-config' => {&CFGDEF_NEGATE => false},
'db-config' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
'db?-config' => {&CFGDEF_RESET => false},
},
},
@ -1970,8 +1975,8 @@ my %hConfigDefine =
&CFGDEF_REQUIRED => false,
&CFGDEF_NAME_ALT =>
{
'db-ssh-port' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'db?-ssh-port' => {&CFGDEF_NEGATE => false},
'db-ssh-port' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
'db?-ssh-port' => {&CFGDEF_RESET => false},
},
},
@ -1981,8 +1986,8 @@ my %hConfigDefine =
&CFGDEF_DEFAULT => 'postgres',
&CFGDEF_NAME_ALT =>
{
'db-user' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'db?-user' => {&CFGDEF_NEGATE => false},
'db-user' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
'db?-user' => {&CFGDEF_RESET => false},
},
&CFGDEF_REQUIRED => false,
},
@ -1995,8 +2000,8 @@ my %hConfigDefine =
&CFGDEF_REQUIRED => true,
&CFGDEF_NAME_ALT =>
{
'db-path' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'db?-path' => {&CFGDEF_NEGATE => false},
'db-path' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
'db?-path' => {&CFGDEF_RESET => false},
},
&CFGDEF_COMMAND =>
{
@ -2033,8 +2038,8 @@ my %hConfigDefine =
&CFGDEF_DEFAULT => 5432,
&CFGDEF_NAME_ALT =>
{
'db-port' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'db?-port' => {&CFGDEF_NEGATE => false},
'db-port' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
'db?-port' => {&CFGDEF_RESET => false},
},
&CFGDEF_COMMAND =>
{
@ -2060,8 +2065,8 @@ my %hConfigDefine =
&CFGDEF_REQUIRED => false,
&CFGDEF_NAME_ALT =>
{
'db-socket-path' => {&CFGDEF_INDEX => 1, &CFGDEF_NEGATE => false},
'db?-socket-path' => {&CFGDEF_NEGATE => false},
'db-socket-path' => {&CFGDEF_INDEX => 1, &CFGDEF_RESET => false},
'db?-socket-path' => {&CFGDEF_RESET => false},
},
},
);
@ -2138,8 +2143,8 @@ foreach my $strKey (sort(keys(%hConfigDefine)))
$hConfigDefine{$strKey}{&CFGDEF_INDEX_TOTAL} = 1;
}
# All config options can be negated. Boolean command-line options must be marked for negation individually.
if (defined($hConfigDefine{$strKey}{&CFGDEF_SECTION}))
# All boolean config options can be negated. Boolean command-line options must be marked for negation individually.
if ($hConfigDefine{$strKey}{&CFGDEF_TYPE} eq CFGDEF_TYPE_BOOLEAN && defined($hConfigDefine{$strKey}{&CFGDEF_SECTION}))
{
$hConfigDefine{$strKey}{&CFGDEF_NEGATE} = true;
}
@ -2150,6 +2155,16 @@ foreach my $strKey (sort(keys(%hConfigDefine)))
$hConfigDefine{$strKey}{&CFGDEF_NEGATE} = false;
}
# All config options can be reset
if (defined($hConfigDefine{$strKey}{&CFGDEF_SECTION}))
{
$hConfigDefine{$strKey}{&CFGDEF_RESET} = true;
}
elsif (!$hConfigDefine{$strKey}{&CFGDEF_RESET})
{
$hConfigDefine{$strKey}{&CFGDEF_RESET} = false;
}
# By default options are not secure
if (!defined($hConfigDefine{$strKey}{&CFGDEF_SECURE}))
{

View File

@ -757,9 +757,9 @@
<text>Commands are used to execute the various <backrest/> functions. Here the command options are listed exhaustively, that is, each option applicable to a command is listed with that command even if it applies to one or more other commands. This includes all the options that may also configured in <file>pgbackrest.conf</file>.
Non-boolean options configured in <file>pgbackrest.conf</file> can be reset to default on the command-line by using the <id>no-</id> prefix. This feature may be used to restore a backup directly on a backup host. Normally, <backrest/> will error because it can see that the database host is remote and restores cannot be done remotely. By adding <br-option>--no-pg1-host</br-option> on the command-line, <backrest/> will ignore the remote database host and restore locally. It may be necessary to pass a new <br-option>--pg-path</br-option> to force the restore to happen in a specific path, i.e. not the path used on the database host.
Non-boolean options configured in <file>pgbackrest.conf</file> can be reset to default on the command-line by using the <id>reset-</id> prefix. This feature may be used to restore a backup directly on a backup host. Normally, <backrest/> will error because it can see that the database host is remote and restores cannot be done remotely. By adding <br-option>--reset-pg1-host</br-option> on the command-line, <backrest/> will ignore the remote database host and restore locally. It may be necessary to pass a new <br-option>--pg-path</br-option> to force the restore to happen in a specific path, i.e. not the path used on the database host.
If the <id>no-</id> prefix is used with a boolean option then the option is set to false.</text>
The <id>no-</id> prefix may be used to set a boolean option to false on the command-line.</text>
<operation-general title="General Options">
<option-list>

View File

@ -49,7 +49,7 @@
</release-item>
<release-item>
<p>Allow any non-boolean, non-command-line option to be negated. This allows specific options in <file>pgbackrest.conf</file> to be ignored (and set to default) which reduces the need to write new configuration files for specific needs. Note that boolean, non-command-line options are already negatable.</p>
<p>Allow any non-command-line option to be reset to default on the command-line. This allows options in <file>pgbackrest.conf</file> to be reset to default which reduces the need to write new configuration files for specific needs.</p>
</release-item>
<release-item>

View File

@ -126,6 +126,8 @@ sub configLoad
$oOption{$strOptionName}{valid} = true;
$oOption{$strOptionName}{source} =
defined($rhOption->{$strOptionName}{source}) ? $rhOption->{$strOptionName}{source} : CFGDEF_SOURCE_DEFAULT;
$oOption{$strOptionName}{reset} = false;
$oOption{$strOptionName}{negate} = false;
# If option is negated only boolean will have a value
if ($rhOption->{$strOptionName}{negate})
@ -137,11 +139,14 @@ sub configLoad
$oOption{$strOptionName}{value} = false;
}
}
# Else reset the option
elsif ($rhOption->{$strOptionName}{reset})
{
$oOption{$strOptionName}{reset} = true;
}
# Else set the value
else
{
$oOption{$strOptionName}{negate} = false;
if (defined($rhOption->{$strOptionName}{value}))
{
if (cfgDefOptionType($iOptionId) eq CFGDEF_TYPE_BOOLEAN)
@ -575,11 +580,10 @@ sub cfgCommandWrite
$strExeString .= cfgCommandWriteOptionFormat($strOption, $bMulti, $bSecure, $oValue);
}
# Else is negated and is not a boolean (which is handled above)
elsif (cfgDefOptionValid($iNewCommandId, $iOptionId) && $oOption{$strOption}{negate} &&
cfgDefOptionType($iOptionId) ne CFGDEF_TYPE_BOOLEAN)
# Else is reset
elsif (cfgDefOptionValid($iNewCommandId, $iOptionId) && $oOption{$strOption}{reset})
{
$strExeString .= " --no-${strOption}";
$strExeString .= " --reset-${strOption}";
}
}

View File

@ -7,7 +7,7 @@ Automatically generated by Build.pm -- do not modify directly.
/***********************************************************************************************************************************
Command data
***********************************************************************************************************************************/
ConfigCommandData configCommandData[CFG_COMMAND_TOTAL] = CONFIG_COMMAND_LIST
static ConfigCommandData configCommandData[CFG_COMMAND_TOTAL] = CONFIG_COMMAND_LIST
(
CONFIG_COMMAND
(
@ -93,7 +93,7 @@ ConfigCommandData configCommandData[CFG_COMMAND_TOTAL] = CONFIG_COMMAND_LIST
/***********************************************************************************************************************************
Option data
***********************************************************************************************************************************/
ConfigOptionData configOptionData[CFG_OPTION_TOTAL] = CONFIG_OPTION_LIST
static ConfigOptionData configOptionData[CFG_OPTION_TOTAL] = CONFIG_OPTION_LIST
(
//------------------------------------------------------------------------------------------------------------------------------
CONFIG_OPTION

View File

@ -87,13 +87,14 @@ typedef struct ConfigOptionValue
{
bool valid:1;
bool negate:1;
bool reset:1;
unsigned int source:2;
Variant *value;
Variant *defaultValue;
} ConfigOptionValue;
ConfigOptionValue configOptionValue[CFG_OPTION_TOTAL];
static ConfigOptionValue configOptionValue[CFG_OPTION_TOTAL];
/***********************************************************************************************************************************
Initialize or reinitialize the configuration data
@ -436,10 +437,26 @@ void
cfgOptionNegateSet(ConfigOption optionId, bool negate)
{
cfgOptionCheck(optionId);
configOptionValue[optionId].negate = negate;
}
/***********************************************************************************************************************************
Was the option reset?
***********************************************************************************************************************************/
bool
cfgOptionReset(ConfigOption optionId)
{
cfgOptionCheck(optionId);
return configOptionValue[optionId].reset;
}
void
cfgOptionResetSet(ConfigOption optionId, bool reset)
{
cfgOptionCheck(optionId);
configOptionValue[optionId].reset = reset;
}
/***********************************************************************************************************************************
Get and set config options
***********************************************************************************************************************************/

View File

@ -53,6 +53,8 @@ const KeyValue *cfgOptionKv(ConfigSource optionId);
const VariantList *cfgOptionLst(ConfigSource optionId);
const char *cfgOptionName(ConfigOption optionId);
bool cfgOptionNegate(ConfigOption optionId);
bool cfgOptionReset(ConfigOption optionId);
void cfgOptionResetSet(ConfigOption optionId, bool reset);
ConfigSource cfgOptionSource(ConfigSource optionId);
const String *cfgOptionStr(ConfigSource optionId);
bool cfgOptionValid(ConfigOption optionId);

View File

@ -7,7 +7,7 @@ Automatically generated by Build.pm -- do not modify directly.
/***********************************************************************************************************************************
Command define data
***********************************************************************************************************************************/
ConfigDefineCommandData configDefineCommandData[] = CFGDEFDATA_COMMAND_LIST
static ConfigDefineCommandData configDefineCommandData[] = CFGDEFDATA_COMMAND_LIST
(
CFGDEFDATA_COMMAND
(
@ -213,7 +213,7 @@ ConfigDefineCommandData configDefineCommandData[] = CFGDEFDATA_COMMAND_LIST
/***********************************************************************************************************************************
Option define data
***********************************************************************************************************************************/
ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
(
// -----------------------------------------------------------------------------------------------------------------------------
CFGDEFDATA_OPTION
@ -225,7 +225,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("archive")
@ -258,7 +257,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("backup")
@ -299,7 +297,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("backup")
@ -348,7 +345,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("archive")
@ -386,7 +382,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("archive")
@ -422,7 +417,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("backup")
@ -457,7 +451,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -515,7 +508,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("backup")
@ -545,7 +537,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -588,7 +579,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -608,7 +598,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -642,7 +631,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -684,7 +672,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -729,7 +716,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -773,7 +759,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("restore")
@ -805,7 +790,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -848,7 +832,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -884,7 +867,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -998,7 +980,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -1017,7 +998,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("restore")
@ -1051,7 +1031,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("restore")
@ -1078,7 +1057,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -1122,7 +1100,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("log")
@ -1183,7 +1160,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("log")
@ -1244,7 +1220,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("log")
@ -1310,7 +1285,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("log")
@ -1355,7 +1329,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("log")
@ -1398,7 +1371,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("backup")
@ -1431,7 +1403,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -1479,7 +1450,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -1555,7 +1525,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -1599,7 +1568,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -1637,7 +1605,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(true)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -1668,7 +1635,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(8)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("stanza")
@ -1732,7 +1698,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(8)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("stanza")
@ -1774,7 +1739,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(8)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("stanza")
@ -1817,7 +1781,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(8)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("stanza")
@ -1858,7 +1821,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(8)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("stanza")
@ -1901,7 +1863,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(8)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("stanza")
@ -1975,7 +1936,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(8)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("stanza")
@ -2016,7 +1976,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(8)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("stanza")
@ -2057,7 +2016,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -2094,7 +2052,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -2129,7 +2086,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -2173,7 +2129,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("restore")
@ -2220,7 +2175,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(true)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2270,7 +2224,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2324,7 +2277,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2359,7 +2311,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2440,7 +2391,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2481,7 +2431,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2523,7 +2472,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2563,7 +2511,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2607,7 +2554,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2657,7 +2603,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2710,7 +2655,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2760,7 +2704,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2810,7 +2753,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2860,7 +2802,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2910,7 +2851,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(true)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -2960,7 +2900,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(true)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -3010,7 +2949,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -3060,7 +2998,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -3112,7 +3049,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("repository")
@ -3168,7 +3104,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("backup")
@ -3201,7 +3136,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("expire")
@ -3242,7 +3176,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("expire")
@ -3286,7 +3219,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("expire")
@ -3319,7 +3251,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("expire")
@ -3353,7 +3284,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -3389,7 +3319,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -3430,7 +3359,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("general")
@ -3507,7 +3435,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("backup")
@ -3541,7 +3468,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("backup")
@ -3580,7 +3506,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("restore")
@ -3611,7 +3536,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(true)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_HELP_SECTION("restore")
@ -3642,7 +3566,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -3683,7 +3606,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -3739,7 +3661,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -3784,7 +3705,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -3828,7 +3748,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(true)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -3853,7 +3772,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(true)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -3884,7 +3802,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(true)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
@ -3913,7 +3830,6 @@ ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
CFGDEFDATA_OPTION_INTERNAL(false)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_NEGATE(false)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST

View File

@ -44,7 +44,6 @@ typedef struct ConfigDefineOptionData
unsigned int internal:1; // Is the option only used internally?
unsigned int indexTotal:4; // 0 normally, > 0 if indexed option (e.g. pg1-*)
unsigned int section:2; // Config section (e.g. global, stanza, cmd-line)
bool negate:1; // Can the option be negated?
bool required:1; // Is the option required?
bool secure:1; // Does the option need to be redacted on logs and cmd-line?
unsigned int commandValid:15; // Bitmap for commands that the option is valid for
@ -70,8 +69,6 @@ typedef struct ConfigDefineOptionData
.indexTotal = indexTotalParam,
#define CFGDEFDATA_OPTION_INTERNAL(internalParam) \
.internal = internalParam,
#define CFGDEFDATA_OPTION_NEGATE(negateParam) \
.negate = negateParam,
#define CFGDEFDATA_OPTION_REQUIRED(requiredParam) \
.required = requiredParam,
#define CFGDEFDATA_OPTION_SECTION(sectionParam) \
@ -581,16 +578,6 @@ cfgDefOptionName(ConfigDefineOption optionDefId)
return configDefineOptionData[optionDefId].name;
}
/***********************************************************************************************************************************
Can the option be negated?
***********************************************************************************************************************************/
bool
cfgDefOptionNegate(ConfigDefineOption optionDefId)
{
cfgDefOptionCheck(optionDefId);
return configDefineOptionData[optionDefId].negate;
}
/***********************************************************************************************************************************
Option prefix for indexed options
***********************************************************************************************************************************/

View File

@ -54,7 +54,6 @@ int cfgDefOptionId(const char *optionName);
int cfgDefOptionIndexTotal(ConfigDefineOption optionDefId);
bool cfgDefOptionInternal(ConfigDefineCommand commandDefId, ConfigDefineOption optionDefId);
const char *cfgDefOptionName(ConfigDefineOption optionDefId);
bool cfgDefOptionNegate(ConfigDefineOption optionDefId);
const char *cfgDefOptionPrefix(ConfigDefineOption optionDefId);
bool cfgDefOptionRequired(ConfigDefineCommand commandDefId, ConfigDefineOption optionDefId);
ConfigDefSection cfgDefOptionSection(ConfigDefineOption optionDefId);

File diff suppressed because it is too large Load Diff

View File

@ -19,11 +19,14 @@ Parse option flags
// Offset the option values so they don't conflict with getopt_long return codes
#define PARSE_OPTION_FLAG (1 << 31)
// Add a flag for negation rather than checking "-no-"
// Add a flag for negation rather than checking "--no-"
#define PARSE_NEGATE_FLAG (1 << 30)
// Add a flag for reset rather than checking "--reset-"
#define PARSE_RESET_FLAG (1 << 29)
// Indicate that option name has been deprecated and will be removed in a future release
#define PARSE_DEPRECATE_FLAG (1 << 29)
#define PARSE_DEPRECATE_FLAG (1 << 28)
// Mask to exclude all flags and get at the actual option id (only 12 bits allowed for option id, the rest reserved for flags)
#define PARSE_OPTION_MASK 0xFFF
@ -40,6 +43,7 @@ typedef struct ParseOption
{
bool found:1; // Was the option found on the command line?
bool negate:1; // Was the option negated on the command line?
bool reset:1; // Was the option reset on the command line?
unsigned int source:2; // Where was to option found?
StringList *valueList; // List of values found
} ParseOption;
@ -86,6 +90,7 @@ configParse(int argListSize, const char *argList[])
int optionListIdx; // Index of option is list (if an option was returned)
ConfigOption optionId; // Option id extracted from option var
bool negate; // Option is being negated
bool reset; // Option is being reset
bool argFound = false; // Track args found to decide on error or help at the end
StringList *commandParamList = NULL; // List of command parameters
@ -157,6 +162,7 @@ configParse(int argListSize, const char *argList[])
// Get option id and flags from the option code
optionId = option & PARSE_OPTION_MASK;
negate = option & PARSE_NEGATE_FLAG;
reset = option & PARSE_RESET_FLAG;
// Make sure the option id is valid
assert(optionId < CFG_OPTION_TOTAL);
@ -166,6 +172,7 @@ configParse(int argListSize, const char *argList[])
{
parseOptionList[optionId].found = true;
parseOptionList[optionId].negate = negate;
parseOptionList[optionId].reset = reset;
parseOptionList[optionId].source = cfgSourceParam;
// Only set the argument if the option requires one
@ -179,10 +186,22 @@ configParse(int argListSize, const char *argList[])
if (parseOptionList[optionId].negate && negate)
THROW(OptionInvalidError, "option '%s' is negated multiple times", cfgOptionName(optionId));
// Make sure option is not reset more than once. Same justification as negate.
if (parseOptionList[optionId].reset && reset)
THROW(OptionInvalidError, "option '%s' is reset multiple times", cfgOptionName(optionId));
// Don't allow an option to be both negated and reset
if ((parseOptionList[optionId].reset && negate) || (parseOptionList[optionId].negate && reset))
THROW(OptionInvalidError, "option '%s' cannot be negated and reset", cfgOptionName(optionId));
// Don't allow an option to be both set and negated
if (parseOptionList[optionId].negate != negate)
THROW(OptionInvalidError, "option '%s' cannot be set and negated", cfgOptionName(optionId));
// Don't allow an option to be both set and reset
if (parseOptionList[optionId].reset != reset)
THROW(OptionInvalidError, "option '%s' cannot be set and reset", cfgOptionName(optionId));
// Error if this option does not allow multiple arguments
if (!(cfgDefOptionType(cfgOptionDefIdFromId(optionId)) == cfgDefOptTypeHash ||
cfgDefOptionType(cfgOptionDefIdFromId(optionId)) == cfgDefOptTypeList))
@ -229,7 +248,7 @@ configParse(int argListSize, const char *argList[])
// Get the command definition id
ConfigDefineCommand commandDefId = cfgCommandDefIdFromId(cfgCommand());
if (!parseOptionList[cfgOptConfig].negate)
if (!parseOptionList[cfgOptConfig].negate && !parseOptionList[cfgOptConfig].reset)
{
// Get the config file name from the command-line if it exists else default
const String *configFile = NULL;
@ -294,6 +313,12 @@ configParse(int argListSize, const char *argList[])
LOG_WARN("'%s' contains negate option '%s'", strPtr(configFile), strPtr(key));
continue;
}
// Warn if reset option found in config
else if (optionList[optionIdx].val & PARSE_RESET_FLAG)
{
LOG_WARN("'%s' contains reset option '%s'", strPtr(configFile), strPtr(key));
continue;
}
optionId = optionList[optionIdx].val & PARSE_OPTION_MASK;
ConfigDefineOption optionDefId = cfgOptionDefIdFromId(optionId);
@ -422,11 +447,16 @@ configParse(int argListSize, const char *argList[])
}
// Is the value set for this option?
bool optionSet = parseOption->found && (optionDefType == cfgDefOptTypeBoolean || !parseOption->negate);
bool optionSet =
parseOption->found && (optionDefType == cfgDefOptTypeBoolean || !parseOption->negate) &&
!parseOption->reset;
// Set negate flag
cfgOptionNegateSet(optionId, parseOption->negate);
// Set reset flag
cfgOptionResetSet(optionId, parseOption->reset);
// Check option dependencies
bool dependResolved = true;

View File

@ -57,17 +57,21 @@ perlOptionJson()
strCat(result, "config");
strCat(result, "\"");
// Add a comma if another define will be added
if (cfgOption(optionId) != NULL)
strCat(result, ",");
}
// If option was negated
if (cfgOptionNegate(optionId))
strCatFmt(result, ",\"negate\":%s", strPtr(varStrForce(varNewBool(true))));
strCatFmt(result, "\"negate\":%s", strPtr(varStrForce(varNewBool(true))));
// Else if option was reset
else if (cfgOptionReset(optionId))
strCatFmt(result, "\"reset\":%s", strPtr(varStrForce(varNewBool(true))));
// Else not negated and has a value
else if (cfgOption(optionId) != NULL)
{
if (cfgOptionSource(optionId) != cfgSourceDefault)
strCat(result, ",");
strCat(result, "\"value\":");
switch (cfgDefOptionType(cfgOptionDefIdFromId(optionId)))

View File

@ -1575,9 +1575,9 @@ restore, backup '[BACKUP-FULL-2]', expect exit 72 - restore errors on backup hos
P00 ERROR: [072]: restore command must be run on the db host
restore, backup '[BACKUP-FULL-2]' - on backup host (backup host)
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --set=[BACKUP-FULL-2] --log-level-console=detail --no-pg1-host --pg1-path=[TEST_PATH]/backup/db --stanza=db restore
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --set=[BACKUP-FULL-2] --log-level-console=detail --reset-pg1-host --pg1-path=[TEST_PATH]/backup/db --stanza=db restore
------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: restore command begin [BACKREST-VERSION]: --no-compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --lock-path=[TEST_PATH]/backup/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --no-pg1-host --pg1-path=[TEST_PATH]/backup/db --protocol-timeout=60 --repo1-path=[TEST_PATH]/backup/repo --set=[BACKUP-FULL-2] --stanza=db
P00 INFO: restore command begin [BACKREST-VERSION]: --no-compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --lock-path=[TEST_PATH]/backup/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --reset-pg1-host --pg1-path=[TEST_PATH]/backup/db --protocol-timeout=60 --repo1-path=[TEST_PATH]/backup/repo --set=[BACKUP-FULL-2] --stanza=db
P00 INFO: restore backup set [BACKUP-FULL-2]
P00 INFO: remap $PGDATA directory to [TEST_PATH]/backup/db
P00 WARN: contents of directory link pg_stat will be restored in a directory at the same location

View File

@ -589,7 +589,7 @@ sub run
$oHostBackup->restore(
'on backup host', $strFullBackup,
{rhExpectedManifest => \%oManifest, strUser => TEST_USER,
strOptionalParam => "${strLogReduced} --no-pg1-host --pg1-path=${strBackupHostDbPath}"});
strOptionalParam => "${strLogReduced} --reset-pg1-host --pg1-path=${strBackupHostDbPath}"});
$oHostDbMaster->backup(
$strType, 'backup errors on db host',

View File

@ -99,6 +99,11 @@ testRun()
TEST_RESULT_VOID(cfgOptionNegateSet(cfgOptConfig, true), "set negate");
TEST_RESULT_BOOL(cfgOptionNegate(cfgOptConfig), true, "negate is set");
// -------------------------------------------------------------------------------------------------------------------------
TEST_RESULT_BOOL(cfgOptionReset(cfgOptConfig), false, "reset defaults to false");
TEST_RESULT_VOID(cfgOptionResetSet(cfgOptConfig, true), "set reset");
TEST_RESULT_BOOL(cfgOptionReset(cfgOptConfig), true, "reset is set");
// -------------------------------------------------------------------------------------------------------------------------
TEST_RESULT_BOOL(cfgOptionValid(cfgOptConfig), false, "valid defaults to false");
TEST_RESULT_VOID(cfgOptionValidSet(cfgOptConfig, true), "set valid");

View File

@ -100,10 +100,6 @@ testRun()
TEST_RESULT_BOOL(cfgDefOptionInternal(cfgDefCmdRestore, cfgDefOptPgHost), true, "option pg-host is internal");
TEST_RESULT_BOOL(cfgDefOptionInternal(cfgDefCmdRestore, cfgDefOptTest), true, "option test is internal");
TEST_ERROR(cfgDefOptionNegate(cfgDefOptionTotal()), AssertError, optionIdInvalidHighError);
TEST_RESULT_BOOL(cfgDefOptionNegate(cfgDefOptOnline), true, "option can be negated");
TEST_RESULT_BOOL(cfgDefOptionNegate(cfgDefOptType), false, "option cannot be negated");
TEST_RESULT_STR(cfgDefOptionPrefix(cfgDefOptPgHost), "pg", "option prefix");
TEST_RESULT_STR(cfgDefOptionPrefix(cfgDefOptType), NULL, "option has no prefix");

View File

@ -61,6 +61,14 @@ testRun()
TEST_ERROR(
configParse(strLstSize(argList), strLstPtr(argList)), OptionInvalidError, "option 'online' is negated multiple times");
// -------------------------------------------------------------------------------------------------------------------------
argList = strLstNew();
strLstAdd(argList, strNew(TEST_BACKREST_EXE));
strLstAdd(argList, strNew("--reset-pg1-host"));
strLstAdd(argList, strNew("--reset-pg1-host"));
TEST_ERROR(
configParse(strLstSize(argList), strLstPtr(argList)), OptionInvalidError, "option 'pg1-host' is reset multiple times");
// -------------------------------------------------------------------------------------------------------------------------
argList = strLstNew();
strLstAdd(argList, strNew(TEST_BACKREST_EXE));
@ -69,6 +77,23 @@ testRun()
TEST_ERROR(
configParse(strLstSize(argList), strLstPtr(argList)), OptionInvalidError, "option 'config' cannot be set and negated");
// -------------------------------------------------------------------------------------------------------------------------
argList = strLstNew();
strLstAdd(argList, strNew(TEST_BACKREST_EXE));
strLstAdd(argList, strNew("--log-path=/var/log"));
strLstAdd(argList, strNew("--reset-log-path"));
TEST_ERROR(
configParse(strLstSize(argList), strLstPtr(argList)), OptionInvalidError, "option 'log-path' cannot be set and reset");
// -------------------------------------------------------------------------------------------------------------------------
argList = strLstNew();
strLstAdd(argList, strNew(TEST_BACKREST_EXE));
strLstAdd(argList, strNew("--no-compress"));
strLstAdd(argList, strNew("--reset-compress"));
TEST_ERROR(
configParse(strLstSize(argList), strLstPtr(argList)), OptionInvalidError,
"option 'compress' cannot be negated and reset");
// -------------------------------------------------------------------------------------------------------------------------
argList = strLstNew();
strLstAdd(argList, strNew(TEST_BACKREST_EXE));
@ -316,12 +341,17 @@ testRun()
strLstAdd(argList, strNew("--stanza=db"));
strLstAdd(argList, strNew("--pg1-path=/path/to/db"));
strLstAdd(argList, strNew("--no-online"));
strLstAdd(argList, strNew("--no-config"));
strLstAdd(argList, strNew(TEST_COMMAND_BACKUP));
TEST_RESULT_VOID(configParse(strLstSize(argList), strLstPtr(argList)), TEST_COMMAND_BACKUP " command");
TEST_RESULT_INT(cfgCommand(), cfgCmdBackup, " command is " TEST_COMMAND_BACKUP);
TEST_RESULT_STR(strPtr(cfgExe()), TEST_BACKREST_EXE, " exe is set");
TEST_RESULT_PTR(cfgOption(cfgOptConfig), NULL, " config is not set");
TEST_RESULT_INT(cfgOptionSource(cfgOptConfig), cfgSourceParam, " config is source param");
TEST_RESULT_BOOL(cfgOptionNegate(cfgOptConfig), true, " config is negated");
TEST_RESULT_INT(cfgOptionSource(cfgOptStanza), cfgSourceParam, " stanza is source param");
TEST_RESULT_STR(strPtr(cfgOptionStr(cfgOptStanza)), "db", " stanza is set");
TEST_RESULT_INT(cfgOptionSource(cfgOptStanza), cfgSourceParam, " stanza is source param");
TEST_RESULT_STR(strPtr(cfgOptionStr(cfgOptPgPath)), "/path/to/db", " pg1-path is set");
@ -339,7 +369,7 @@ testRun()
strLstAdd(argList, strNew("--stanza=db"));
strLstAdd(argList, strNewFmt("--config=%s", strPtr(configFile)));
strLstAdd(argList, strNew("--no-online"));
strLstAdd(argList, strNew("--pg1-host=db"));
strLstAdd(argList, strNew("--reset-pg1-host"));
strLstAdd(argList, strNew(TEST_COMMAND_BACKUP));
storagePut(storageLocal(), configFile, bufNewStr(strNew(
@ -350,6 +380,7 @@ testRun()
"repo1-hardlink=y\n"
"bogus=bogus\n"
"no-compress=y\n"
"reset-compress=y\n"
"archive-copy=y\n"
"online=y\n"
"pg1-path=/not/path/to/db\n"
@ -372,10 +403,13 @@ testRun()
"WARN: '%s' contains option 'recovery-option' invalid for section 'db:backup'\n"
"WARN: '%s' contains invalid option 'bogus'\n"
"WARN: '%s' contains negate option 'no-compress'\n"
"WARN: '%s' contains reset option 'reset-compress'\n"
"WARN: '%s' contains command-line only option 'online'\n"
"WARN: '%s' contains stanza-only option 'pg1-path' in global section 'global:backup'",
strPtr(configFile), strPtr(configFile), strPtr(configFile), strPtr(configFile), strPtr(configFile))));
strPtr(configFile), strPtr(configFile), strPtr(configFile), strPtr(configFile), strPtr(configFile),
strPtr(configFile))));
TEST_RESULT_PTR(cfgOption(cfgOptPgHost), NULL, " pg1-path is not defined");
TEST_RESULT_STR(strPtr(cfgOptionStr(cfgOptPgPath)), "/path/to/db", " pg1-path is set");
TEST_RESULT_INT(cfgOptionSource(cfgOptPgPath), cfgSourceConfig, " pg1-path is source config");
TEST_RESULT_BOOL(cfgOptionBool(cfgOptCompress), false, " compress not is set");

View File

@ -46,6 +46,9 @@ testRun()
cfgOptionNegateSet(cfgOptOnline, true);
cfgOptionSet(cfgOptOnline, cfgSourceParam, varNewBool(false));
cfgOptionValidSet(cfgOptPgHost, true);
cfgOptionResetSet(cfgOptPgHost, true);
cfgOptionValidSet(cfgOptProtocolTimeout, true);
cfgOptionSet(cfgOptProtocolTimeout, cfgSourceParam, varNewDbl(1.1));
@ -61,6 +64,7 @@ testRun()
"\"compress\":{\"source\":\"param\",\"value\":true},"
"\"compress-level\":{\"source\":\"config\",\"value\":3},"
"\"online\":{\"source\":\"param\",\"negate\":true},"
"\"pg1-host\":{\"reset\":true},"
"\"protocol-timeout\":{\"source\":\"param\",\"value\":1.1},"
"\"stanza\":{\"value\":\"db\"}"
"}')|[NULL]",