diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-01-09 14:49:11 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2020-01-09 20:16:03 +0900 |
commit | a5279634c025002d77ca92bf84c86180992a372c (patch) | |
tree | 5593cae10b1193ffcfdb07f89f48d9337f885bd7 /src/mount | |
parent | 6ae6ea55d81d01519b15c3790fafb6f57c97b9c1 (diff) | |
download | systemd-a5279634c025002d77ca92bf84c86180992a372c.tar.gz |
systemd-mount: add --no-legend command line option
Diffstat (limited to 'src/mount')
-rw-r--r-- | src/mount/mount-tool.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c index 4091412878..69f140fb3e 100644 --- a/src/mount/mount-tool.c +++ b/src/mount/mount-tool.c @@ -45,6 +45,7 @@ enum { static bool arg_no_block = false; static PagerFlags arg_pager_flags = 0; +static bool arg_legend = true; static bool arg_ask_password = true; static bool arg_quiet = false; static BusTransport arg_transport = BUS_TRANSPORT_LOCAL; @@ -90,6 +91,7 @@ static int help(void) { " --version Show package version\n" " --no-block Do not wait until operation finished\n" " --no-pager Do not pipe output into a pager\n" + " --no-legend Do not show the headers\n" " --no-ask-password Do not prompt for password\n" " -q --quiet Suppress information messages during runtime\n" " --user Run as user unit\n" @@ -125,6 +127,7 @@ static int parse_argv(int argc, char *argv[]) { ARG_VERSION = 0x100, ARG_NO_BLOCK, ARG_NO_PAGER, + ARG_NO_LEGEND, ARG_NO_ASK_PASSWORD, ARG_USER, ARG_SYSTEM, @@ -146,6 +149,7 @@ static int parse_argv(int argc, char *argv[]) { { "version", no_argument, NULL, ARG_VERSION }, { "no-block", no_argument, NULL, ARG_NO_BLOCK }, { "no-pager", no_argument, NULL, ARG_NO_PAGER }, + { "no-legend", no_argument, NULL, ARG_NO_LEGEND }, { "no-ask-password", no_argument, NULL, ARG_NO_ASK_PASSWORD }, { "quiet", no_argument, NULL, 'q' }, { "user", no_argument, NULL, ARG_USER }, @@ -196,6 +200,10 @@ static int parse_argv(int argc, char *argv[]) { arg_pager_flags |= PAGER_DISABLE; break; + case ARG_NO_LEGEND: + arg_legend = false; + break; + case ARG_NO_ASK_PASSWORD: arg_ask_password = false; break; @@ -1389,6 +1397,8 @@ static int list_devices(void) { if (r < 0) return log_error_errno(r, "Failed to set sort index: %m"); + table_set_header(table, arg_legend); + FOREACH_DEVICE(e, d) { for (c = 0; c < _COLUMN_MAX; c++) { const char *x = NULL; |