diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-15 10:56:28 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-17 21:09:14 +0100 |
commit | 6906da26926365b6b8c06cd81f1dac4f49288041 (patch) | |
tree | a65b20efd83184d3779e179469f698aa88efc7fa /src/systemctl/systemctl-list-unit-files.c | |
parent | b01031e3ff937e0ceff70aae58253bb22b5a05f4 (diff) | |
download | systemd-6906da26926365b6b8c06cd81f1dac4f49288041.tar.gz |
systemctl: hide legends with --quiet, allow overriding
--no-legend is replaced by --legend=no.
--quiet now implies --legend=no, but --legend=yes may be used to override that.
--quiet controls hints and warnings and such, and --legend controls just the
legends. I think it makes sense to allow both to controlled independently, in
particular --quiet --legend makes sense when using systemctl in a script to
provide some user-visible output.
Fixes #18560.
Diffstat (limited to 'src/systemctl/systemctl-list-unit-files.c')
-rw-r--r-- | src/systemctl/systemctl-list-unit-files.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl-list-unit-files.c b/src/systemctl/systemctl-list-unit-files.c index e1bf876620..95911172a3 100644 --- a/src/systemctl/systemctl-list-unit-files.c +++ b/src/systemctl/systemctl-list-unit-files.c @@ -58,7 +58,7 @@ static int output_unit_file_list(const UnitFileList *units, unsigned c) { if (!table) return log_oom(); - table_set_header(table, !arg_no_legend); + table_set_header(table, arg_legend != 0); if (arg_full) table_set_width(table, 0); @@ -127,7 +127,7 @@ static int output_unit_file_list(const UnitFileList *units, unsigned c) { if (r < 0) return r; - if (!arg_no_legend) + if (arg_legend != 0) printf("\n%u unit files listed.\n", c); return 0; |