mirror of
https://github.com/systemd/systemd.git
synced 2025-01-26 14:04:03 +03:00
busctl: use the pager everywhere
There is no reason to assume that the user doesn't want the pager even if they are looking at xml output or such.
This commit is contained in:
parent
8ff8ce6284
commit
8722b297e5
@ -354,8 +354,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
|
||||
return log_error_errno(r, "Failed to fill line: %m");
|
||||
}
|
||||
|
||||
if (IN_SET(arg_json, JSON_OFF, JSON_PRETTY))
|
||||
(void) pager_open(arg_pager_flags);
|
||||
(void) pager_open(arg_pager_flags);
|
||||
|
||||
if (arg_json)
|
||||
r = table_print_json(table, stdout, (arg_json == JSON_PRETTY ? JSON_FORMAT_PRETTY : JSON_FORMAT_NEWLINE) | JSON_FORMAT_COLOR_AUTO);
|
||||
@ -1004,6 +1003,7 @@ static int introspect(int argc, char **argv, void *userdata) {
|
||||
|
||||
if (arg_xml_interface) {
|
||||
/* Just dump the received XML and finish */
|
||||
(void) pager_open(arg_pager_flags);
|
||||
puts(xml);
|
||||
return 0;
|
||||
}
|
||||
@ -1088,17 +1088,14 @@ static int introspect(int argc, char **argv, void *userdata) {
|
||||
return bus_log_parse_error(r);
|
||||
}
|
||||
|
||||
(void) pager_open(arg_pager_flags);
|
||||
|
||||
name_width = STRLEN("NAME");
|
||||
type_width = STRLEN("TYPE");
|
||||
signature_width = STRLEN("SIGNATURE");
|
||||
result_width = STRLEN("RESULT/VALUE");
|
||||
name_width = strlen("NAME");
|
||||
type_width = strlen("TYPE");
|
||||
signature_width = strlen("SIGNATURE");
|
||||
result_width = strlen("RESULT/VALUE");
|
||||
|
||||
sorted = newa(Member*, set_size(members));
|
||||
|
||||
SET_FOREACH(m, members, i) {
|
||||
|
||||
if (argv[3] && !streq(argv[3], m->interface))
|
||||
continue;
|
||||
|
||||
@ -1123,6 +1120,8 @@ static int introspect(int argc, char **argv, void *userdata) {
|
||||
|
||||
typesafe_qsort(sorted, k, member_compare_funcp);
|
||||
|
||||
(void) pager_open(arg_pager_flags);
|
||||
|
||||
if (arg_legend) {
|
||||
printf("%-*s %-*s %-*s %-*s %s\n",
|
||||
(int) name_width, "NAME",
|
||||
@ -1375,6 +1374,8 @@ static int status(int argc, char **argv, void *userdata) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
(void) pager_open(arg_pager_flags);
|
||||
|
||||
if (!isempty(argv[1])) {
|
||||
r = parse_pid(argv[1], &pid);
|
||||
if (r < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user