1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Revert "cleanup: simplier assign of cmd vars"

This reverts commit cea441f4d1.

cmd->default_values is configurable and this code should not make
any assumptions about values it holds.
This commit is contained in:
Alasdair G Kergon 2016-10-03 18:14:17 +01:00
parent 9e33781d95
commit c900cf7ed4

View File

@ -1049,19 +1049,23 @@ static int _get_settings(struct cmd_context *cmd)
const char *activation_mode; const char *activation_mode;
cmd->current_settings = cmd->default_settings; cmd->current_settings = cmd->default_settings;
cmd->current_settings.verbose = arg_count(cmd, verbose_ARG);
cmd->current_settings.test = arg_is_set(cmd, test_ARG);
if (arg_is_set(cmd, debug_ARG)) if (arg_is_set(cmd, debug_ARG))
cmd->current_settings.debug = _LOG_FATAL + cmd->current_settings.debug = _LOG_FATAL +
(arg_count(cmd, debug_ARG) - 1); (arg_count(cmd, debug_ARG) - 1);
if (arg_is_set(cmd, verbose_ARG))
cmd->current_settings.verbose = arg_count(cmd, verbose_ARG);
if (arg_is_set(cmd, quiet_ARG)) { if (arg_is_set(cmd, quiet_ARG)) {
cmd->current_settings.debug = 0; cmd->current_settings.debug = 0;
cmd->current_settings.verbose = 0; cmd->current_settings.verbose = 0;
cmd->current_settings.silent = (arg_count(cmd, quiet_ARG) > 1) ? 1 : 0; cmd->current_settings.silent = (arg_count(cmd, quiet_ARG) > 1) ? 1 : 0;
} }
if (arg_is_set(cmd, test_ARG))
cmd->current_settings.test = arg_is_set(cmd, test_ARG);
if (arg_is_set(cmd, driverloaded_ARG)) { if (arg_is_set(cmd, driverloaded_ARG)) {
cmd->current_settings.activation = cmd->current_settings.activation =
arg_int_value(cmd, driverloaded_ARG, arg_int_value(cmd, driverloaded_ARG,