diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-06-22 14:26:55 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2022-06-22 14:31:42 +0200 |
commit | b6ec23a01aa12d44722771f48b0b32d6a40a9dad (patch) | |
tree | 584e2338cccf2902d8d375904b4112e30923e24d /src | |
parent | network: l2tp: initialize a to NULL (diff) | |
download | systemd-b6ec23a01aa12d44722771f48b0b32d6a40a9dad.tar.xz systemd-b6ec23a01aa12d44722771f48b0b32d6a40a9dad.zip |
udevadm info: implement --no-pager
Diffstat (limited to 'src')
-rw-r--r-- | src/udev/udevadm-info.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index d76dda95f1..b9af7769da 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -51,6 +51,7 @@ static bool arg_export = false; static bool arg_value = false; static const char *arg_export_prefix = NULL; static usec_t arg_wait_for_initialization_timeout = 0; +PagerFlags arg_pager_flags = 0; /* Put a limit on --tree descent level to not exhaust our stack */ #define TREE_DEPTH_MAX 64 @@ -496,7 +497,8 @@ static int help(void) { " -e --export-db Export the content of the udev database\n" " -c --cleanup-db Clean up the udev database\n" " -w --wait-for-initialization[=SECONDS]\n" - " Wait for device to be initialized\n", + " Wait for device to be initialized\n" + " --no-pager Do not pipe output into a pager\n", program_invocation_short_name); return 0; @@ -667,6 +669,7 @@ int info_main(int argc, char *argv[], void *userdata) { enum { ARG_PROPERTY = 0x100, ARG_VALUE, + ARG_NO_PAGER, }; static const struct option options[] = { @@ -686,6 +689,7 @@ int info_main(int argc, char *argv[], void *userdata) { { "value", no_argument, NULL, ARG_VALUE }, { "version", no_argument, NULL, 'V' }, { "wait-for-initialization", optional_argument, NULL, 'w' }, + { "no-pager", no_argument, NULL, ARG_NO_PAGER }, {} }; @@ -779,6 +783,9 @@ int info_main(int argc, char *argv[], void *userdata) { return print_version(); case 'h': return help(); + case ARG_NO_PAGER: + arg_pager_flags |= PAGER_DISABLE; + break; case '?': return -EINVAL; default: @@ -810,7 +817,7 @@ int info_main(int argc, char *argv[], void *userdata) { if (strv_isempty(devices)) { assert(action == ACTION_TREE); - pager_open(0); + pager_open(arg_pager_flags); return print_tree(NULL); } |