mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cleanup: simplier assign of cmd vars
Directly assign queried args as they provide matching values for a setting.
This commit is contained in:
parent
00f883a4aa
commit
cea441f4d1
@ -1049,23 +1049,19 @@ static int _get_settings(struct cmd_context *cmd)
|
||||
const char *activation_mode;
|
||||
|
||||
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))
|
||||
cmd->current_settings.debug = _LOG_FATAL +
|
||||
(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)) {
|
||||
cmd->current_settings.debug = 0;
|
||||
cmd->current_settings.verbose = 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)) {
|
||||
cmd->current_settings.activation =
|
||||
arg_int_value(cmd, driverloaded_ARG,
|
||||
|
Loading…
Reference in New Issue
Block a user