From: Lennart Poettering Date: Fri, 10 Nov 2017 20:40:47 +0000 (+0100) Subject: merge two lines in our get_output_flags() functions X-Git-Tag: v236~235^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=459b9f9ff7852144cf3ba380d9374acb3d46b328;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 3e917cb3f57..c849db7b086 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -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; } diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 8d78a0d3c0a..968be322dd3 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -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; } diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 7730c06ba24..670bff999c9 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -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; }