merge two lines in our get_output_flags() functions
loginctl, machinectl, systemctl all have very similar implementations of a get_output_flags() functions. Simplify it by merging two lines that set the same flag.
This commit is contained in:
parent
0b3c84eb7d
commit
459b9f9ff7
|
@ -66,8 +66,7 @@ static OutputFlags get_output_flags(void) {
|
|||
|
||||
return
|
||||
arg_all * OUTPUT_SHOW_ALL |
|
||||
arg_full * OUTPUT_FULL_WIDTH |
|
||||
(!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
|
||||
(arg_full || !on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
|
||||
colors_enabled() * OUTPUT_COLOR;
|
||||
}
|
||||
|
||||
|
|
|
@ -93,8 +93,7 @@ static int print_addresses(sd_bus *bus, const char *name, int, const char *pr1,
|
|||
static OutputFlags get_output_flags(void) {
|
||||
return
|
||||
arg_all * OUTPUT_SHOW_ALL |
|
||||
arg_full * OUTPUT_FULL_WIDTH |
|
||||
(!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
|
||||
(arg_full || !on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
|
||||
colors_enabled() * OUTPUT_COLOR |
|
||||
!arg_quiet * OUTPUT_WARN_CUTOFF;
|
||||
}
|
||||
|
|
|
@ -280,8 +280,7 @@ static void polkit_agent_open_maybe(void) {
|
|||
static OutputFlags get_output_flags(void) {
|
||||
return
|
||||
arg_all * OUTPUT_SHOW_ALL |
|
||||
arg_full * OUTPUT_FULL_WIDTH |
|
||||
(!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
|
||||
(arg_full || !on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
|
||||
colors_enabled() * OUTPUT_COLOR |
|
||||
!arg_quiet * OUTPUT_WARN_CUTOFF;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue