From b683b82fe77092b06835e75b53de4ddb5f9cdfe8 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 10 Jan 2020 12:19:47 +0900 Subject: [PATCH] busctl: introduce --full command line option --- man/busctl.xml | 9 +++++++++ src/busctl/busctl.c | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/man/busctl.xml b/man/busctl.xml index 2f7eb99951..eebc42105d 100644 --- a/man/busctl.xml +++ b/man/busctl.xml @@ -388,6 +388,15 @@ + + + + + + Do not ellipsize the output in list command. + + + diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 878837eb7e..aec323749c 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -38,6 +38,7 @@ static enum { } arg_json = JSON_OFF; static PagerFlags arg_pager_flags = 0; static bool arg_legend = true; +static bool arg_full = false; static const char *arg_address = NULL; static bool arg_unique = false; static bool arg_acquired = false; @@ -195,6 +196,9 @@ static int list_bus_names(int argc, char **argv, void *userdata) { if (!table) return log_oom(); + if (arg_full) + table_set_width(table, 0); + r = table_set_align_percent(table, table_get_cell(table, 0, COLUMN_PID), 100); if (r < 0) return log_error_errno(r, "Failed to set alignment: %m"); @@ -2251,6 +2255,7 @@ static int help(void) { " --version Show package version\n" " --no-pager Do not pipe output into a pager\n" " --no-legend Do not show the headers and footers\n" + " -l --full Do not ellipsize output\n" " --system Connect to system bus\n" " --user Connect to user bus\n" " -H --host=[USER@]HOST Operate on remote host\n" @@ -2323,6 +2328,7 @@ static int parse_argv(int argc, char *argv[]) { { "version", no_argument, NULL, ARG_VERSION }, { "no-pager", no_argument, NULL, ARG_NO_PAGER }, { "no-legend", no_argument, NULL, ARG_NO_LEGEND }, + { "full", no_argument, NULL, 'l' }, { "system", no_argument, NULL, ARG_SYSTEM }, { "user", no_argument, NULL, ARG_USER }, { "address", required_argument, NULL, ARG_ADDRESS }, @@ -2372,6 +2378,10 @@ static int parse_argv(int argc, char *argv[]) { arg_legend = false; break; + case 'l': + arg_full = true; + break; + case ARG_USER: arg_user = true; break;