mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-26 10:03:40 +03:00
systemctl: show empty cells as '-'
This is mostly relevant for "systemct list-sockets" which can have empty cells for the activating unit.
This commit is contained in:
parent
557b0841b7
commit
0773357ad1
@ -425,6 +425,8 @@ static int output_units_list(const UnitInfo *unit_infos, unsigned c) {
|
||||
if (arg_full)
|
||||
table_set_width(table, 0);
|
||||
|
||||
(void) table_set_empty_string(table, "-");
|
||||
|
||||
for (u = unit_infos; unit_infos && u < unit_infos + c; u++) {
|
||||
_cleanup_free_ char *j = NULL;
|
||||
const char *on_underline = "", *on_loaded = "", *on_active = "";
|
||||
@ -1021,6 +1023,8 @@ static int output_sockets_list(struct socket_info *socket_infos, unsigned cs) {
|
||||
if (arg_full)
|
||||
table_set_width(table, 0);
|
||||
|
||||
(void) table_set_empty_string(table, "-");
|
||||
|
||||
if (cs) {
|
||||
for (s = socket_infos; s < socket_infos + cs; s++) {
|
||||
_cleanup_free_ char *j = NULL, *activates = NULL;
|
||||
@ -1265,6 +1269,8 @@ static int output_timers_list(struct timer_info *timer_infos, unsigned n) {
|
||||
if (arg_full)
|
||||
table_set_width(table, 0);
|
||||
|
||||
(void) table_set_empty_string(table, "-");
|
||||
|
||||
if (n > 0) {
|
||||
for (t = timer_infos; t < timer_infos + n; t++) {
|
||||
_cleanup_free_ char *j = NULL, *activates = NULL;
|
||||
@ -1478,6 +1484,8 @@ static int output_unit_file_list(const UnitFileList *units, unsigned c) {
|
||||
if (arg_full)
|
||||
table_set_width(table, 0);
|
||||
|
||||
(void) table_set_empty_string(table, "-");
|
||||
|
||||
for (const UnitFileList *u = units; u < units + c; u++) {
|
||||
const char *on_underline = NULL, *on_unit_color = NULL, *id;
|
||||
bool underline;
|
||||
@ -2031,6 +2039,8 @@ static int output_machines_list(struct machine_info *machine_infos, unsigned n)
|
||||
if (arg_full)
|
||||
table_set_width(table, 0);
|
||||
|
||||
(void) table_set_empty_string(table, "-");
|
||||
|
||||
for (m = machine_infos; m < machine_infos + n; m++) {
|
||||
_cleanup_free_ char *mname = NULL;
|
||||
const char *on_state = "", *on_failed = "";
|
||||
@ -2351,6 +2361,8 @@ static int output_jobs_list(sd_bus *bus, const struct job_info* jobs, unsigned n
|
||||
if (arg_full)
|
||||
table_set_width(table, 0);
|
||||
|
||||
(void) table_set_empty_string(table, "-");
|
||||
|
||||
for (j = jobs; j < jobs + n; j++) {
|
||||
if (streq(j->state, "running"))
|
||||
on = ansi_highlight();
|
||||
|
Loading…
x
Reference in New Issue
Block a user