]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
merge two lines in our get_output_flags() functions
authorLennart Poettering <lennart@poettering.net>
Fri, 10 Nov 2017 20:40:47 +0000 (21:40 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 10 Nov 2017 20:40:47 +0000 (21:40 +0100)
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.

src/login/loginctl.c
src/machine/machinectl.c
src/systemctl/systemctl.c

index 3e917cb3f57cc53e8ce1ab2e2a985787790f631d..c849db7b086de3de5f555c8bd969f2b9af196a27 100644 (file)
@@ -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;
 }
 
index 8d78a0d3c0a981b8c27154bf87f7494ef7be2681..968be322dd34e55e3f939fade9b48ca0c2e5224d 100644 (file)
@@ -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;
 }
index 7730c06ba2431f7b4beb949eb96d5865b4b9c935..670bff999c9bf64c149e8e94e05ccb639a36b1a7 100644 (file)
@@ -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;
 }