summaryrefslogtreecommitdiffstats
path: root/src/busctl
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-03-28 11:55:21 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-03-28 11:55:21 +0200
commitf735076c548abe9878e98c2da044458dd0e684f3 (patch)
treec006a11d8cd82833ae109094d8a8d34236861740 /src/busctl
parentbusctl: use size_t for set size (diff)
downloadsystemd-f735076c548abe9878e98c2da044458dd0e684f3.tar.xz
systemd-f735076c548abe9878e98c2da044458dd0e684f3.zip
busctl: also assume --full if not writing to terminal
If people grep the output, it probably shouldn't be ellipsized.
Diffstat (limited to 'src/busctl')
-rw-r--r--src/busctl/busctl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c
index 0adceb6d1b..37ba05680f 100644
--- a/src/busctl/busctl.c
+++ b/src/busctl/busctl.c
@@ -39,7 +39,7 @@
static JsonFormatFlags arg_json_format_flags = JSON_FORMAT_OFF;
static PagerFlags arg_pager_flags = 0;
static bool arg_legend = true;
-static bool arg_full = false;
+static int arg_full = -1;
static const char *arg_address = NULL;
static bool arg_unique = false;
static bool arg_acquired = false;
@@ -215,7 +215,7 @@ static int list_bus_names(int argc, char **argv, void *userdata) {
if (!table)
return log_oom();
- if (arg_full)
+ if (arg_full > 0)
table_set_width(table, 0);
r = table_set_align_percent(table, table_get_cell(table, 0, COLUMN_PID), 100);
@@ -1120,7 +1120,7 @@ static int introspect(int argc, char **argv, void *userdata) {
sorted[k++] = m;
}
- if (result_width > 40 && !arg_full)
+ if (result_width > 40 && arg_full <= 0)
result_width = 40;
typesafe_qsort(sorted, k, member_compare_funcp);
@@ -2550,6 +2550,9 @@ static int parse_argv(int argc, char *argv[]) {
assert_not_reached();
}
+ if (arg_full < 0)
+ arg_full = terminal_is_dumb();
+
return 1;
}