diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-11 12:56:29 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-11-14 16:25:11 +0100 |
commit | 0221d68a1317407960ea6f88bd4ebc1781999332 (patch) | |
tree | aa6f7d5c2280c44df790b7c042756c8302a4e788 /src/machine/machinectl.c | |
parent | journalctl: do not treat EINTR as an error when waiting for events (diff) | |
download | systemd-0221d68a1317407960ea6f88bd4ebc1781999332.tar.xz systemd-0221d68a1317407960ea6f88bd4ebc1781999332.zip |
basic/pager: convert the pager options to a flags argument
Pretty much everything uses just the first argument, and this doesn't make this
common pattern more complicated, but makes it simpler to pass multiple options.
Diffstat (limited to 'src/machine/machinectl.c')
-rw-r--r-- | src/machine/machinectl.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index d408d80c14..5dd46fc4a7 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -57,7 +57,7 @@ static char **arg_property = NULL; static bool arg_all = false; static bool arg_value = false; static bool arg_full = false; -static bool arg_no_pager = false; +static PagerFlags arg_pager_flags = 0; static bool arg_legend = true; static const char *arg_kill_who = NULL; static int arg_signal = SIGTERM; @@ -278,7 +278,7 @@ static int list_machines(int argc, char *argv[], void *userdata) { assert(bus); - (void) pager_open(arg_no_pager, false); + (void) pager_open(arg_pager_flags); r = sd_bus_call_method(bus, "org.freedesktop.machine1", @@ -358,7 +358,7 @@ static int list_images(int argc, char *argv[], void *userdata) { assert(bus); - (void) pager_open(arg_no_pager, false); + (void) pager_open(arg_pager_flags); r = sd_bus_call_method(bus, "org.freedesktop.machine1", @@ -753,7 +753,7 @@ static int show_machine(int argc, char *argv[], void *userdata) { properties = !strstr(argv[0], "status"); - (void) pager_open(arg_no_pager, false); + (void) pager_open(arg_pager_flags); if (properties && argc <= 1) { @@ -1091,7 +1091,7 @@ static int show_image(int argc, char *argv[], void *userdata) { properties = !strstr(argv[0], "status"); - (void) pager_open(arg_no_pager, false); + (void) pager_open(arg_pager_flags); if (argc <= 1) { @@ -2396,7 +2396,7 @@ static int list_transfers(int argc, char *argv[], void *userdata) { double progress; int r; - (void) pager_open(arg_no_pager, false); + (void) pager_open(arg_pager_flags); r = sd_bus_call_method(bus, "org.freedesktop.import1", @@ -2612,7 +2612,7 @@ static int help(int argc, char *argv[], void *userdata) { _cleanup_free_ char *link = NULL; int r; - (void) pager_open(arg_no_pager, false); + (void) pager_open(arg_pager_flags); r = terminal_urlify_man("machinectl", "1", &link); if (r < 0) @@ -2852,7 +2852,7 @@ static int parse_argv(int argc, char *argv[]) { break; case ARG_NO_PAGER: - arg_no_pager = true; + arg_pager_flags |= PAGER_DISABLE; break; case ARG_NO_LEGEND: |